log4j: disable output for console (root-logger)

J

Joerg Lensing

Hi ng,
I want to disable the output to the console when logging to file. See
config-file below:


log4j.rootLogger=INFO, A1

log4j.logger.de.softcon.webcontrol.presentation=DEBUG,A3
log4j.logger.com.cappuccinonet.strutscx=WARN
log4j.logger.org.apache=WARN

log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d %-5p - %m%n



log4j.appender.A3=org.apache.log4j.FileAppender
log4j.appender.A3.File=C:\\joergslog2.log
log4j.appender.A3.layout=org.apache.log4j.PatternLayout
log4j.appender.A3.layout.ConversionPattern=<userClick time="%d" thread="%t" %m />%n


I call the log by:
Logger debugLogger = Logger.getLogger("de.softcon.webcontrol.presentation");
debugLogger.debug("some logging output");

How can I disable the output to console(System.out)??

tx joerg
 
G

GaryM

(e-mail address removed) (Joerg Lensing) wrote in
Hi ng,
I want to disable the output to the console when logging to file.
See config-file below:


log4j.rootLogger=INFO, A1

comment out the A1 above and you're good to go.
 
S

Simon Niederberger

Your appender A1 is defined as a ConsoleAppender. Remove A1 as appender
entirely or make it a FileAppender. Also I'm not sure where INFO will go if
you don't specify the appender type.

Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top