How to pass 'environment' variable to Log4J under Tomcat

N

news.rcn.com

I want to specify the location of a log file in the environment and have it
used when Log4J is configured when Tomcat starts. Something like this;

The log4j config file might contain
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=${MYAPP_LOG_DIR}/myAppsLog.log
where ${MYAPP_LOG_DIR} would get interpolated when Tomcat reads the log4j
configuration.
The value might be passed into tomcat with something like
java .....tomcat -DMYAPP_LOG_DIR=c:\myLogDir ... start

I believe I seen references to something like this but Googling about hasn't
turned it up. Any help, suggestions?

Thank - jim cant
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top