changing log file of log4j for an individual package within a webapp running on Tomcat

V

vishal.changrani

Hi All,
I am running a WebApp (JSP/Servlet/Struts) on Tomcat 4.0.6
I am having a ServletContextListener which spawns a thread which runs
indifinetly.
Is there a way I can make this thread (the source code of which comes
from a seperate package) log to a different log file than the
remaining WebApp? The Webapp is NOT using log4j but is using Commons-
logging (since I dont see log4j.jar file in the lib folder but a
logger element in the Server.xml). I do intend to use log4j though.
If I do however put a log4j.properties file in my web-inf/classes
folder and the log4j in the web-ing/lib folder...all the logging of
the webapp gets written to the file i specify in the log4j.properties
file. I however only want all the classes only in that particular
package to write to that log file.

Any help will be much apreciated
Thanks in advance,
Vishal
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

I am running a WebApp (JSP/Servlet/Struts) on Tomcat 4.0.6
I am having a ServletContextListener which spawns a thread which runs
indifinetly.
Is there a way I can make this thread (the source code of which comes
from a seperate package) log to a different log file than the
remaining WebApp? The Webapp is NOT using log4j but is using Commons-
logging (since I dont see log4j.jar file in the lib folder but a
logger element in the Server.xml). I do intend to use log4j though.
If I do however put a log4j.properties file in my web-inf/classes
folder and the log4j in the web-ing/lib folder...all the logging of
the webapp gets written to the file i specify in the log4j.properties
file. I however only want all the classes only in that particular
package to write to that log file.

You can specify appenders per category. Just specify an appender
logging to a different file for the category used in that particular
code.

Arne
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top