Brent Evans | 13 Jul 2012 17:01
Picon

Threshold Levels


Hi,

I'm currently trying to configure syslog4j (which is using a
log4j.properties file) to carry out logging on my system. The properties
file is below:

log4j.rootLogger=DEBUG, syslog

log4j.category.EventLogger=INFO, syslogAudit
log4j.additivity.EventLogger=false

log4j.appender.syslog=com.org.CustomAppender
log4j.appender.syslog.protocol=tcp
log4j.appender.syslog.host=localhost
log4j.appender.syslog.port=6500
log4j.appender.syslog.facility=LOCAL2

log4j.appender.syslogAudit=com.org.CustomAppender
log4j.appender.syslogAudit.Threshold=INFO
log4j.appender.syslogAudit.protocol=tcp
log4j.appender.syslogAudit.host=localhost
log4j.appender.syslogAudit.port=6500
log4j.appender.syslog.facility=LOCAL3

What I'm trying to achieve here is for all messages to be output to the
syslog logger and then for all messages that are INFO and above to be output
as well to the syslogAudit logger. The problem is that the Threshold level
is not being applied, so Debug messages are currently being included in the
syslogAudit logger. I have noticed that removing the syslog logger allows
(Continue reading)

Douglas E Wegscheid | 13 Jul 2012 18:59
Favicon

Re: Threshold Levels

try running with -Dlog4j.debug, it'll tell you what information log4j is 
really getting out of the config...

should log4j.appender.syslogAudit.Threshold=INFO have a lowercase 'T' in 
it?


■ DOUGLAS E. WEGSCHEID // LEAD ENGINEER
(269) 923-5278 // Douglas_E_Wegscheid <at> whirlpool.com
"A wrong note played hesitatingly is a wrong note. A wrong note played 
with conviction is interpretation."

Brent Evans <brentevans88 <at> gmail.com> wrote on 07/13/2012 11:01:35 AM:

> 
> Hi,
> 
> I'm currently trying to configure syslog4j (which is using a
> log4j.properties file) to carry out logging on my system. The properties
> file is below:
> 
> log4j.rootLogger=DEBUG, syslog
> 
> log4j.category.EventLogger=INFO, syslogAudit
> log4j.additivity.EventLogger=false
> 
> log4j.appender.syslog=com.org.CustomAppender
> log4j.appender.syslog.protocol=tcp
> log4j.appender.syslog.host=localhost
> log4j.appender.syslog.port=6500
(Continue reading)

Brett Randall | 13 Jul 2012 22:18
Picon

Re: Threshold Levels

It looks like you may have a copy/paste error in your config. In the
second, syslogAudit appender:

log4j.appender.syslog.facility=LOCAL3

should be

log4j.appender.syslogAudit.facility=LOCAL3

Best
Brett

On 7/14/12, Brent Evans <brentevans88 <at> gmail.com> wrote:
>
> Hi,
>
> I'm currently trying to configure syslog4j (which is using a
> log4j.properties file) to carry out logging on my system. The properties
> file is below:
>
> log4j.rootLogger=DEBUG, syslog
>
> log4j.category.EventLogger=INFO, syslogAudit
> log4j.additivity.EventLogger=false
>
> log4j.appender.syslog=com.org.CustomAppender
> log4j.appender.syslog.protocol=tcp
> log4j.appender.syslog.host=localhost
> log4j.appender.syslog.port=6500
> log4j.appender.syslog.facility=LOCAL2
(Continue reading)

Brent Evans | 14 Jul 2012 12:04
Picon

Re: Threshold Levels


Thanks for the help guys. It appears that if I set the threshold level for
each appender, rather than just the one that I wanted, then it will work
fine, eg:

log4j.appender.syslog=com.org.CustomAppender
log4j.appender.syslogAudit.Threshold=DEBUG
log4j.appender.syslog.protocol=tcp
log4j.appender.syslog.host=localhost
log4j.appender.syslog.port=6500
log4j.appender.syslog.facility=LOCAL2

log4j.appender.syslogAudit=com.org.CustomAppender
log4j.appender.syslogAudit.Threshold=INFO
log4j.appender.syslogAudit.protocol=tcp
log4j.appender.syslogAudit.host=localhost
log4j.appender.syslogAudit.port=6500
log4j.appender.syslogAudit.facility=LOCAL3

javabrett wrote:
> 
> It looks like you may have a copy/paste error in your config. In the
> second, syslogAudit appender:
> 
> log4j.appender.syslog.facility=LOCAL3
> 
> should be
> 
> log4j.appender.syslogAudit.facility=LOCAL3
> 
(Continue reading)


Gmane