Hi guys,
I've seen a few threads on what I'm about to ask but no success when
following them. I'd like to split my logging such that one appender logs all
messages of DEBUG level and above and another logs all messages of WARN level
and above. My current log4j config file is:
log4j.rootLogger=DEBUG, myappender, SOCK
log4j.appender.myappender=org.apache.log4j.RollingFileAppender
log4j.appender.myappender.File=../../log/abc.log
log4j.appender.myappender.MaxFileSize=100KB
log4j.appender.myappender.MaxBackupIndex=1
log4j.appender.myappender.layout=org.apache.log4j.PatternLayout
log4j.appender.myappender.layout.ConversionPattern=%d %-5p - %m%n
log4j.appender.SOCK=org.apache.log4j.net.SocketAppender
log4j.appender.SOCK.RemoteHost=localhost
log4j.appender.SOCK.Port=9245
log4j.appender.SOCK.layout.ConversionPattern=%d{%d-%b %H:%M:%S.%J} tid[%t] %-5p
%l %m%n
log4j.appender.SOCK.layout.TimeZone=GB
log4j.appender.SOCK.LocationInfo=true
log4j.appender.threshold.SOCK=WARN
log4j.debug=true
So I'm hoping that 'myappender' logs DEBUG and above and SOCK logs WARN and
above but this doesn't seem to work. Does any body have a working example of
this I could look at?
I'm using log4cxx 0.9.7 and I need to use with non-XML config.
Many Thanks
Amit
Amit Sarna
Exchange Links Team
Equities IT
One Cabot Square,
London, E14 4QJ
Tel: +44 20 7883 8268
==============================================================================
Please access the attached hyperlink for an important electronic communications
disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================