Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
vishal.changrani@gmail.com - 29 May 2007 19:49 GMT
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
Arne Vajhøj - 03 Jun 2007 02:51 GMT
> I am running a WebApp (JSP/Servlet/Struts) on Tomcat 4.0.6
> I am having a ServletContextListener which spawns a thread which runs
[quoted text clipped - 9 lines]
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.