• 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

Issues with log4j in Tomcat

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been trying to get my (smartgwt)application to log using the log4j jar. It works fine in Dev Mode, but when I deploy it to tomcat the log files denoted by the configuration don't even seem to appear.

The following log4j.properties file is in my war directory for my app:


Just to get it working I have a simple class with static log methods only accessing the rootLogger:


On server side calls I simply have statements such as:


Are there settings within the Tomcat environment to allow application specific use of log4j, or am I simply going about this wrong? I have read in a few places about people saying to put my .properties file into WEB-INF/classes directory, but when my war file is unpacked by Tomcat I don't see that directory.
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to ensure that the .properties file is on the CLASSPATH, WEB-INF/classes is definitely a safe place for that purpose. Are you using exploded WARs? If so you can try dropping in the .properties file after the WAR deployment.
reply
    Bookmark Topic Watch Topic
  • New Topic