• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Himai Minh

need help with first time setup of log4j

Posts: 1810
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have it working on my local server setup, but can't get it working on the Tomcat/Red Hat box. The log file is never created and nothing appears in catalina.out, which if I understand correctly, is where the console appender messages should appear. Please correct me if that's wrong.

The log4j.jar file is in the Tomcat /lib directory and the log4j.properties file is in mywebapp/WEB-INF/classes. Here is the properties file:

# map this appender as the root logger
# set the debugging on for testing the log4j setup

log4j.rootLogger=DEBUG, R, consoleAppender

# console appender
log4j.appender.consoleAppender.layout.ConversionPattern=%-5p %c{2} %x - %m%n

# file appender
log4j.appender.R.layout.ConversionPattern=%-5p %c{2} %x - %m%n

# set the maximum log file size
# archive log files (one backup file here)

I'm at a loss as to how to troubleshoot this any further. I've restarted the webapp and even restarted Tomcat with no change. There are no errors in catalina.out and no errors from the app when it hits the log.debug statements.

At this point I'm thinking about creating a simple, single page jsp test app that runs in it's own context to try and confirm that log4j is working, but I feel like I'm clutching at straws. Any tips? Am I correct that console appender messages should appear in catalina.out?
It would give a normal human mental abilities to rival mine. To think it is just a tiny ad:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic