logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Winston Huang" <weiqi...@mail.com>
Subject Use different log files inside one program
Date Fri, 29 Oct 2004 13:41:59 GMT
hi there,

i have a java program that behaves like a cron job which kicks off
jobs based on certain conditions. each job is implemented by a a
Runnable. i would like to have each job use a different log file. the
best i can do so far is to set NDC for the Runnable or print out the
thread name in the output. but all the logs still go to the same
file. it's more convenient if each job can write to a different log
file, identified by the job name for example. is there any way to do
it? 

note that each Runnable can invoke other common classes which in turn
use log4j inside. e.g. Runnable1 may call Util.foo, and Runnable2 may
call Util.foo as well. the logging output from Util.foo should go to
different log files based on the Runnable. however Util.foo uses the
static logger that's assoicated with the Util class itself. 

any help is greatly appreciated. 
Winston

-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message