logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Refr Bruhl <refr_br...@yahoo.com>
Subject Log4j with multiple files converting to xml
Date Wed, 08 Dec 2010 16:16:44 GMT

Greetings

I tried searching for this on the mail archives link, the link seems to be 
changed.

My goal:
I have 4 files for logging. ConLogger -> logs to console, lgLogger -> logs to a 
log file, qryLogger that logs to a log file, delLogger that logs to a log file, 
and exLogger that logs to a log file

lgLogger logs generall aplication activity. I have used addAppender to ensure 
everything logged to the console is also logged to lgLogger
qryLogger logs nothing but query information
exLogger logs all exception errors

All 4 of these files can support debug thru fatal entries.

I have used this same pattern in several "batch" type jobs for about 4 years 
now.

These files are configured in the primary java class.

What I want to do is change the configuration from "hard" coding these log files 
in the app to using xml files for configuration. 


The problem I am running into is it seems when using xml or property files log4j 
makes the assumption of only one logger with multiple appenders per xml file. I 
want or think I want 4 distinct loggers with each having a separate appender.

Is this correct? Has anyone else tried to do something similar with log4j? Any 
idea on how to achieve this?


Thanks!


 --Refr inn gra


"Wars are to be won with swords and spears, 
not with rice and salt." -- Uesugi Kenshin



      
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message