This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Tomcat 5.5.12 and log4J 1.3 Alpha7 -- how configure

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
No holds barred. And no bars holed. Except this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!