• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tomcat 5.5.12 and log4J 1.3 Alpha7 -- how configure

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic