logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: how to log to different files
Date Tue, 01 Jun 2004 13:07:12 GMT
You are on the right track.  Now you just have to set additivity to "false" 
for each named logger that you don't want to inherit from the root 
logger.  Can't remember the syntax for that in properties files, though.  I 
never use them.  Hopefully someone else can provide the syntax.


At 03:34 PM 6/1/2004 +0800, you wrote:
>I wish to have output from classes to go into a log file and some other
>classes (from the same packages) into another log file. I have the
>following log4j.properties configuration but it doesn't work.
> >From the config, there are 4 fours that I wish to go into 'searchfile'
>and all the other classes to log to 'file'.
>What this produces is both files (searchfile and file) are created and
>contains exactly the same logs. All logs (including those from the 4
>classes) goes into both the files.
>This is what I have in my Java files.
>static Logger logger = Logger.getLogger(CatCrawler.class);
>log4j.appender.file.layout.ConversionPattern=%d [%t] %5p %c{1}:%M - %m%n
>log4j.appender.searchfile.layout.ConversionPattern=%d [%t] %5p %c{1}:%M
>- %m%n
>log4j.appender.stdout.layout.ConversionPattern=%d [%t] %5p %c{1}:%M -
>log4j.rootLogger=DEBUG, file, stdout
>log4j.logger.sg.edu.astar.bii.catcrawler.ui.CrawlSearchProcess = DEBUG,
>log4j.logger.sg.edu.astar.bii.catcrawler.crawler.WebCrawler = DEBUG,
>log4j.logger.sg.edu.astar.bii.catcrawler.crawler.HTMLFilter = DEBUG,
>log4j.logger.sg.edu.astar.bii.catcrawler.crawler.IndexHTML = DEBUG,
>Sebastian Ho
>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-user-help@logging.apache.org

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

View raw message