[ 
https://issues.apache.org/jira/browse/HADOOP-6884?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12902985#action_12902985
 ] 

Konstantin Shvachko commented on HADOOP-6884:
---------------------------------------------

I am reluctant to migrate to SLF4J at the moment for 3 main reasons. 
# Yes, SLF4J does provide a way to log more efficiently, but it also has the 
regular method {{void debug(String msg)}} so people will just use it as they 
did before. In my approach I intentionally excluded it from the api.
# Migrating to SLF4J will mean changing logging for all levels in the entire 
project(s). This issue is targeting only debug messages.
Logging is a big deal. apache.commons worked for us for a long time, will SLF4J 
- I don't know. There are analytic tools out there relying on the format of the 
logs, will SLF4J break them? All this needs investigation. Just optimizing 
debug logging will not affect anything except improving the performance.
# In fact, people in this discussion mentioned that creating extra object[] is 
a performance problem. I tried to address this issue in my proposal. And I 
think this makes a big difference compared to SLF4J, because 90% of the calls 
will end up executing the optimized versions of logDebug().

> Add LOG.isDebugEnabled() guard for each LOG.debug("...")
> --------------------------------------------------------
>
>                 Key: HADOOP-6884
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6884
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.22.0
>            Reporter: Erik Steffl
>            Assignee: Erik Steffl
>             Fix For: 0.22.0
>
>         Attachments: FunAgain.java, FunAgain.java, HADOOP-6884-0.22-1.patch, 
> HADOOP-6884-0.22.patch
>
>
> Each LOG.debug("...") should be executed only if LOG.isDebugEnabled() is 
> true, in some cases it's expensive to construct the string that is being 
> printed to log. It's much easier to always use LOG.isDebugEnabled() because 
> it's easier to check (rather than in each case reason whether it's necessary 
> or not).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to