Bug 35563 - Syslog appender parametrability
Summary: Syslog appender parametrability
Status: NEEDINFO
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Appender (show other bugs)
Version: unspecified
Hardware: All All
: P2 enhancement
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-30 17:42 UTC by Xavier de Labouret
Modified: 2007-01-28 03:22 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xavier de Labouret 2005-06-30 17:42:50 UTC
Hello log4j-dev,

Using Log4J in a production environment involving syslog and alerting, we would
like to have some minor parametrability added to the Syslog appender (it may
impact other Log4J parts):

1) Customize the syslog level corresponding to FATAL 

Today the syslog level corresponding to FATAL is EMERG (hardcoded). As FATAL has
no equivalent in syslog, it can be desirable feature to have it customized with
the log4j.properties file. In fact it is desirable for us, for we already use
the ALERT syslog level to raise alerts and reserve EMERG for other specific needs.

==> Proposal: add a FatalSyslogMapping property for syslog appenders, e.g:

log4j.appender.A1=org.apache.log4j.net.SyslogAppender
log4j.appender.A1.SyslogHost=localhost
log4j.appender.A1.Facility=LOCAL7
log4j.appender.A1.FatalSyslogMapping=ALERT


2) Customize the text corresponding to a given level

Today a given Log4J level corresponds to a (hardcoded) string when you print
this level in a file or a syslog log. We would like to use slightly different
strings for the log4j levels, for example:
Level.DEBUG => "debug"
Level.INFO  => "info"
Level.WARN => "warning"
Level.ERROR => "error"
Level.FATAL => "alert"

We would like to customize this with the log4j.properties too, it needs some
more investigation for a concrete proposal. We already use other APIs that
produce this format though, so it is an important need for us to have a unified
log format through syslog.


To address these needs we are going to write our own appender. We may provide
you patches to merge these features to mainstream. Would you be interested in
these patches? Or are you working on such features for Log4j1.3alpha?

Best regards
Comment 1 Elias Ross 2007-01-28 03:22:45 UTC
Submit a patch off of SVN trunk.