| Author |
location of log file when using log4j
|
zelynn goay
Ranch Hand
Joined: Jan 09, 2005
Posts: 30
|
|
hi. i am using log4j to log in my servlet. the servlet will read a .properties file that will be used by log4j. i specify in the .properties file my log file location as <code> log4j.appender.R.File=example.log </code> and i found the log file in <tomcat>/bin/ if i specify <code>log4j.appender.R.File=.\\logs\\example.log</log>, the log file will appear in <tomcat>/bin/logs i wish to specify in my <tomcat>/webapps/myapp/log dir. may i know how should i do that? Appreciate any help.
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
If you use a relative link, the file location will be relative to the present working directory for that JVM (in your case the bin directory). If you provide an absolute path, you can put it whereever you want. I don't know how well it's supported but I've been able to use system properties to build the path: In this case the logs are going to the TOMCAT/logs directory.
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
 |
|
|
subject: location of log file when using log4j
|
|
|