Win a copy of Event Streams in Action this week in the Java in General 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

log4j working, but writing log file to wrong directory

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using Tomcat 5.5.25 and log4j-1.2.15 on a WinXP system. I think I have my classpath issues resolved because log4j is writing to my log file that is defined in my log4j.xml file. However, it's writing it to $CATALINA_HOME\bin.

I remember when doing log4j in Websphere, we had to put in a kind of file prefix for our log files, something like '../opt/......my.log'. Is there a similar prefix that is needed in Tomcat, to direct it to my webapp directory? Ideally, I'd like it under /webapps/mywebapp/logs.

Here's the relevant snippet of my log4j.xml :

 
Sheriff
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right now the file is going to Tomcat's current working directory, because you specified a relative path. But if you want the file to go to a specific directory, there's nothing wrong with saying so:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!