Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem while loading the log4j.xml in to the classpath

843840Feb 26 2009 — edited Feb 27 2009
Hi,
I am working with a web application using tomcat5.0.I am using log4j for logging the information in my application.I am keeping log4j.xml out side of the application(Generally we will keep under WEB-INF/classes ).Now I want to load the log4j.xml from outside location in my ContextListner class.I am using the following code.
String cmd="java -cp -Dlog4j.configuration=C:/sample/log4j.xml"; 
			Runtime runtime = Runtime.getRuntime();
			Process process = null;
			process = runtime.exec(cmd);  
but I am getting the following errors.
log4j:WARN File option not set for appender [stdout].
log4j:WARN Are you using FileAppender instead of ConsoleAppender?
log4j:WARN No appenders could be found for logger (org.apache.catalina.session.ManagerBase).
log4j:WARN Please initialize the log4j system properly.
log4j:ERROR No output stream or file set for the appender named [stdout].
Feb 26, 2009 7:48:28 PM org.apache.coyote.http11.Http11BaseProtocol start
I am not getting where am I doing wrong.

Any Ideas please?

Regards
kondal
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 27 2009
Added on Feb 26 2009
2 comments
1,425 views