I'm trying...
I've read through the manual a bunch of times.
I've read through the "Adding Conversion Characters to PatternLayout" sevreal
times.
I've even been up and down the log4j-user mailing list archives a few times.

We are currently using log4j in the "out of the box way" --> a log4j.properties
file, a single hierarchy...

In every class we instantiate a Category object in this manner:
     Category log = Category.getInstance( this.getClass().getName() );

We say log.error("An error message"); and it gets logged to both appenders, A1,
A2 (see log4j.properties file below):

Here is what I want to do:  With all else remaining the same (ei. An instance of
 Category with the five pre-configured priorities in each
class - like above),  I want to have another Appender (say a JDBCAppender for
this example) that receives all messages that
are to be called like this:

      auditLog.audit("Send this to the security audit trail DB only");  or,
alternately, I would be happy with

auditLog.debug("...");auditLog.info("...");auditLog.warn("...");auditLog.error("...");auditLog.fatal("...");

But I only want the auditLog messages to go to one Appender, the other log
messages would go to A1, A2 (see below).

Do I need to extend Category?  Do I need to worry about a new Hierarchy?  ??????
Please, if possible, could anyone create a bulleted list ( a sentence a piece )
of what needs to be done?

Thanks in advance,
Tim

log4j.configDebug=false
log4j.defaultInitOverride=false
log4j.rootCategory=, A1, A2
log4j.appender.A1=org.log4j.RollingFileAppender
log4j.appender.A1.Append=true
log4j.appender.A1.File=config/YYY1/logs/yyy_web.log
log4j.appender.A1.MaxFileSize=1MB
log4j.appender.A1.MaxBackupIndex=10
log4j.appender.A1.layout=org.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d %-5p at %c{5}.%M(%13F:%L) %3x -
%m\n
log4j.appender.A2=org.log4j.net.SyslogAppender

# this information is used by the yyy log system
log4j.appender.A2.SyslogHost=yyyyy

log4j.appender.A2.Facility=LOCAL0
log4j.appender.A2.FacilityPrinting=
log4j.appender.A2.layout=org.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%-5p at %c{5}.%M(%13F:%L) %3x - %m\n
log4j.category.examples=ERROR





The information in this e-mail, and any attachment therein, is confidential and
for use by the addressee only. If you are not the intended recipient, please
return the e-mail to the sender and delete it from your computer. Although the
Bank of New York attempts to sweep e-mail and attachments for viruses, it does
not guarantee that either are virus-free and accepts no liability for any damage
sustained as a result of viruses.




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to