Excellent, thank you so much! -----Original Message----- From: Curt Arnold [mailto:carn...@apache.org] Sent: 23 January 2009 19:06 To: Log4J Users List Subject: Re: Simultaneous output at different levels
On Jan 23, 2009, at 7:02 AM, DOUTCH GARETH-GDO003 wrote: > How can I configure a logger to log to two appenders simultaneously at > different levels, i.e. file at debug (+ higher) and socket at info (+ > higher)? > > This is my properties file: > > log4j.logger.myapp=debug, ROLLING_FILE, CHAINSAW_CLIENT > > log4j.appender.CHAINSAW_CLIENT=org.apache.log4j.net.SocketAppender > log4j.appender.CHAINSAW_CLIENT.RemoteHost=localhost > log4j.appender.CHAINSAW_CLIENT.Port=4445 > log4j.appender.CHAINSAW_CLIENT.LocationInfo=true > > > log4j.appender.ROLLING_FILE=org.apache.log4j.RollingFileAppender > log4j.appender.ROLLING_FILE.File=C:\\workdir\\log4j.csv > log4j.appender.ROLLING_FILE.MaxFileSize=200KB > log4j.appender.ROLLING_FILE.MaxBackupIndex=10 > log4j.appender.ROLLING_FILE.layout=org.apache.log4j.PatternLayout > log4j.appender.ROLLING_FILE.layout.ConversionPattern=%d{dd MMM yyyy > HH:mm:ss} -- %p -- %m%n > > Thanks Set the logger level at the lowest level of all the attached appenders and set the threshold of the appenders to suppress undesired levels. Basically, add a log4j.appender.CHAINSAW_CLIENT.threshold=INFO --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org