File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Tomcat 5.5.12 and log4J 1.3 Alpha7 -- how configure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat 5.5.12 and log4J 1.3 Alpha7 -- how configure" Watch "Tomcat 5.5.12 and log4J 1.3 Alpha7 -- how configure" New topic
Author

Tomcat 5.5.12 and log4J 1.3 Alpha7 -- how configure

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi there,
I could need some advice. My application uses log4J 1.3 Alpha7 and needs to run on Tomcat. I deployed the log4j-1.3alpha-7.jar file into the WEB-INF\lib and the log4j.properties into the \WEB-INF\classes.
When the application starts I get 3 info entries on the console, that signal the creation of the loggers in the respective classes. Further than that no logging output happens. The log4j.properties looks like:

#-----------------------------------------------------------------------
# Set root logger level to DEBUG and its appenders A1, Chainsaw.
log4j.rootLogger=DEBUG, A1, Chainsaw

# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender

# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

# Chainsaw is set to be a Chainsaw appender.
log4j.appender.Chainsaw=org.apache.log4j.net.SocketAppender
log4j.appender.Chainsaw.remoteHost=localhost
log4j.appender.Chainsaw.port=4560
log4j.appender.Chainsaw.locationInfo=false

# Chainsaw uses PatternLayout.
log4j.appender.Chainsaw.layout=org.apache.log4j.PatternLayout
log4j.appender.Chainsaw.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
#-----------------------------------------------------------------------

I deployed the same WAR to a Websphere 6.0 and at least got the Console appender running (working on the chainsaw still).

Any hint what I might have missed out? It seems to me the log4j.properties file gets ignored.

Thx and have a great day!
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
The issue seems to be related to commons_logging.jar. Once I included that jar along with the log4j the console logging started to work after a server reboot. I haven't tested the chainsaw yet.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat 5.5.12 and log4J 1.3 Alpha7 -- how configure