You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Stephen Levinson <St...@sun.com> on 2001/09/25 14:01:01 UTC

RE: [Beginner] file configuration based on log severity- please H elp !

In order to control the severity accepted by the different appenders you
must set the THRESHOLD for each appender.

See AppenderSkeleton.setThreshold(...) ... for example ..


Hope this helps,
--Stephen

-----Original Message-----
From: Marchioni Francesco
[mailto:francesco.marchioni@consulenti.fastweb.it]
Sent: Tuesday, September 25, 2001 6:55 AM
To: 'log4j-user@jakarta.apache.org'
Subject: [Beginner] file configuration based on log severity- please
Help !


Hi all,
I'd need to send log messages to different kind of appenders depending on
the
log severity. In particular I'd need

INFO messages---------->File
WARN messages-------->Console

So I tried to config like this:
  

log4j.rootCategory=INFO, A1
log4j.category.A2=WARN

log4j.appender.A1=org.apache.log4j.FileAppender
log4j.appender.A1.File=server.log
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=[%c{1}] %m%n
log4j.appender.A1.Append=false

log4j.appender.A2=org.apache.log4j.ConsoleAppender
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%d [%t] %-5p %c - %m%n 

but I cannot get what I want.....I don't get anything on the console and I
get both info and warn on
the file. Can anybody help me please ?
Thanks a lot

Frank


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org