commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sreenivas velagapudi <>
Subject extending LogFactoryImpl
Date Tue, 14 Feb 2006 06:44:57 GMT
I am using commons-logging and log4j
My commons-logging .properties is as shown below,


I want to write one custom level called AUDIT in log4j

The problem is, that the log level is hard coded into
the method names of log interface of commons-logging
You have "log.error, log.debug, " on the Log

So let's extend it with a new level called "AUDIT"
     * <p> Is AUDIT logging currently enabled? </p>
    * <p> Call this method to prevent having to
perform expensive operations      * (for example,
<code>String</code> concatination)
      * when the log level is more than the fatal
level. </p>
     public boolean isAuditEnabled();

     * <p> Log a message with AUDIT log level. </p>
    * @param message log this message
    public void Audit(Object message);

Which would use a "Audit" log level set by a
In the Log4JAdapter this would be quite a simple

public void audit(Object message) {
   logger.log(FQCN, CustomLevel.Audit, message, null);

so can you please tellme how can i extend the
LogFactoryImpl and create the code for me, if u have
please send the code to me

currently i am using this way

private static final Log log =

                if (log.isDebugEnabled())

I need to add and call new level Audit which i already
created in log4j, i should use this way

                                if (


Do you Yahoo!? 
New and Improved Yahoo! Mail - 1GB free storage!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message