hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HTTPCLIENT-416) Consider replacing commons-logging by SLF4J
Date Tue, 12 Dec 2006 17:46:22 GMT
    [ http://issues.apache.org/jira/browse/HTTPCLIENT-416?page=comments#action_12457819 ] 
Oleg Kalnichevski commented on HTTPCLIENT-416:


Do we stick to commons-logging given its latest improvements and active status or shall we
hold a vote on migrating to SLF4J?


> Consider replacing commons-logging by SLF4J
> -------------------------------------------
>                 Key: HTTPCLIENT-416
>                 URL: http://issues.apache.org/jira/browse/HTTPCLIENT-416
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 3.0 Beta 1
>         Environment: Operating System: Windows 2000
> Platform: PC
>            Reporter: Ortwin Gl├╝ck
>         Assigned To: HttpClient Dev
>            Priority: Minor
>             Fix For: 4.0 Alpha 1
>         Attachments: commons-logging-to-log4j.xml
> As soon as Log4J 1.3 is available a move to UGLI is possible.
> This would improve Log performance with Log4J and render cleaner logging code at
> the same time.
> Ceki writes:
> Since the org.apache.log4j.Logger class is a direct implementation of
> org.apache.ugli.ULogger interface, there is no need to wrap a log4j
> Logger to conform to the UGLI interface. Log4j Loggers are already
> ULoggers. It follows that the objects returned by
> o.a.ugli.LoggerFactory.getLogger("x") are identical to those returned
> by o.a.log4j.Logger.getLogger("x").
> Thus, using UGLI in conjunction with log4j will not carry any overhead
> whatsoever.
> As noted in my previous message, UGLI also supports parameterized log
> messages obliterating the need to surround log messages with
> logger.isXXXEnabled checks.
> Instead of writing:
>   if(logger.isDebugEnabled()) {
>     logger.debug("User with "+id+" entered wrong query string ["+query"]." );
>   }
> you can just write:
>   logger.debug("User with {} entered wrong query string [{}].", id, query);
> Give or take a nano-second, when the log statement is disabled, both
> forms perform equally well but the second form is easier to read and
> to write.

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


To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org

View raw message