directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny (JIRA)" <directory-...@incubator.apache.org>
Subject [jira] Commented: (DIREVE-171) add log4j config patch
Date Sun, 26 Jun 2005 15:11:58 GMT
    [ http://issues.apache.org/jira/browse/DIREVE-171?page=comments#action_12314510 ] 

Emmanuel Lecharny commented on DIREVE-171:
------------------------------------------

Hi, Nick,

could you modify your patch a little bit? The Category class is deprecated (http://www.docjar.com/docs/api/org/apache/log4j/Category.html)
Logger is the class to use.

Is this also possible that you add a test before eacjh log.debug call ?

log.debug( "Search attempt using filter '" + filter + "' "
             + "with scope '" + scope + "' and a return limit of '" + limit
             + "'" );

is expensive as the string is built even if we are not in debug mode.

It's better to write :

if (log.isDebugEnabled()) 
{
    log.debug(...)
}

Even better, add a 
private static final boolean DEBUG = log.isDebugEnabled();

and use it this way :

if (DEBUG)
{
   log.debug(...)
}

As DEBUG will be evaluated only once, the test is faster (no function called).

Thanks a lot !

> add log4j config patch
> ----------------------
>
>          Key: DIREVE-171
>          URL: http://issues.apache.org/jira/browse/DIREVE-171
>      Project: Directory Server
>         Type: Improvement
>   Components: server main
>     Versions: 0.9.1
>     Reporter: Nick Faiz
>     Assignee: Alex Karasulu
>     Priority: Trivial
>  Attachments: log4j.properties, logging_patch.txt
>
> Please find enclosed a patch (diff file) and a log4j.properties file.
> You should create a src/etc directory for main and core and place the properties file
there.
> Cheers,
> Nick

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message