Re: Logging to console and file at different levels

2009-06-17 Thread Jacob Kjome
List your entire logging properties and restate your requirements.  I'm lost on what you tried and didn't try. Jake On Wed, 17 Jun 2009 15:16:39 -0400 Bai Shen wrote: Didn't work. I get nothing in the console, and for some reason I'm getting doubled lines in the file. On Mon, Jun 8, 2009

Re: Logging to console and file at different levels

2009-06-17 Thread Bai Shen
Didn't work. I get nothing in the console, and for some reason I'm getting doubled lines in the file. On Mon, Jun 8, 2009 at 4:45 PM, Jacob Kjome wrote: > Try this... > > log4j.appender.CONSOLE.Threshold=WARN > log4j.rootLogger=WARN, CONSOLE, FILE > log4j.logger.com.myapp=INFO > > > Jake > > >

Re: how to configure logging independently for multiple appenders

2009-06-17 Thread Jacob Kjome
# direct log messages to stderr, which is re-directed by Tomcat # to the tomcat logs. log4j.appender.stderr = org.apache.log4j.ConsoleAppender log4j.appender.stderr.Target = System.err log4j.appender.stderr.layout = org.apache.log4j.PatternLayout log4j.appender.stderr.layout.ConversionPattern

how to configure logging independently for multiple appenders

2009-06-17 Thread Matt Harrison
Hi, This seems like it would be a common use case but I don't see it discussed anywhere. We want: - 2 appenders, 'stderr' and 'SQL' - 'general' logging goes only to the 'stderr' appender - SQL log messages (logger=org.hibernate.SQL) goes to both appenders - JDBC bind params (logger=org.hibern

stderr and stdout rollover

2009-06-17 Thread luri ron
i redirect the stderr and stdout to the same file that the log4j is logging the information to using the following code. String fileName = ((FileAppender) appender).getFile(); if (fileName != null) { PrintStream ps = new PrintStream (new FileOutputStream(new File(fileName), true)); System.setErr