I changed log4j.rootLoger line to : Log4j.rootLogger=debug,stdout,LogFile
Then added Log4j.appender.LogFile.Theshold=info Now what happens is the LogFile appender gets the debug messages (it seems like the rootLogger line takes precendent over the Threshold -- or I'm setting it wrong). Frank -----Original Message----- From: James Stauffer [mailto:[EMAIL PROTECTED] Sent: Monday, July 10, 2006 2:32 PM To: Log4J Users List Subject: Re: properties file question I use the XML format instead of the properties format so this might not be exact: log4j.rootLogger=debug, stdout, LogFile Delete the loggers for the top 3 packages (last 3 lines) Set a threshold of info on the LogFile appender. On 7/10/06, Frank Apap <[EMAIL PROTECTED]> wrote: > 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 > > > > -- James Stauffer Are you good? Take the test at http://www.livingwaters.com/good/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
