logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Apap <f...@optonline.net>
Subject properties file question
Date Mon, 10 Jul 2006 17:55:41 GMT
I'm trying to do something that I'm pretty sure is simple but I cant
seem to figure out exactly what I need in the properties file.
 
I want to have 2 appenders, a file and console.  I want all messages for
all classes to go to the console but only Info (and above - e.g.
everything bug debug) to go to the file, again for all classes.  My
properties file looks like:
 
 
log4j.rootLogger=debug, stdout
 
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
 
# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=[%d] %p %t %c - %m%n
 
log4j.appender.LogFile=org.apache.log4j.RollingFileAppender
log4j.appender.LogFile.File=c:/outlog.log
 
log4j.appender.LogFile.MaxFileSize=500KB
# Keep one backup file
log4j.appender.LogFile.MaxBackupIndex=1
 
 
log4j.appender.LogFile.layout=org.apache.log4j.PatternLayout
log4j.appender.LogFile.layout.ConversionPattern=[%d] %p %t %c - %m%n
 
# setup all top level package names
log4j.logger.agentthreads=info, LogFile
log4j.logger.dbutil=info, LogFile
log4j.logger.com=info, LogFile
 
 
When I do this what happens is that for the package names I list in my
last section I do NOT see debug messages in my stdout appender.
 
Any ideas are appreciated.
 
Frank
 
 

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