Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > log4j: disable output for console (root-logger)

Reply
Thread Tools

log4j: disable output for console (root-logger)

 
 
Joerg Lensing
Guest
Posts: n/a
 
      01-08-2004
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=DE BUG,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.PatternL ayout
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.PatternL ayout
log4j.appender.A3.layout.ConversionPattern=<userCl ick time="%d" thread="%t" %m />%n


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

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

tx joerg
 
Reply With Quote
 
 
 
 
GaryM
Guest
Posts: n/a
 
      01-08-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) (Joerg Lensing) wrote in
news:(E-Mail Removed) om:

>
> 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.
 
Reply With Quote
 
 
 
 
Simon Niederberger
Guest
Posts: n/a
 
      02-12-2004
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


"Joerg Lensing" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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=DE BUG,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.PatternL ayout
> 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.PatternL ayout
> log4j.appender.A3.layout.ConversionPattern=<userCl ick time="%d"

thread="%t" %m />%n
>
>
> I call the log by:
> Logger debugLogger =

Logger.getLogger("de.softcon.webcontrol.presentati on");
> debugLogger.debug("some logging output");
>
> How can I disable the output to console(System.out)??
>
> tx joerg



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading console output and writing to console jan.rebada@gmail.com C++ 5 03-04-2008 09:00 AM
how to control position of output values on output console pratap C++ 3 07-19-2007 02:38 PM
Re: console mp3->wav decoder for $indows or GUI one which supports console Serge Terekhoff Python 0 06-30-2003 12:36 PM
Re: console mp3->wav decoder for $indows or GUI one which supports console Egor Bolonev Python 0 06-30-2003 10:43 AM
Re: console mp3->wav decoder for $indows or GUI one which supports console Ben Finney Python 2 06-30-2003 05:43 AM



Advertisments