[ 
https://issues.apache.org/jira/browse/LOG4J2-991?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14481360#comment-14481360
 ] 

ASF GitHub Bot commented on LOG4J2-991:
---------------------------------------

GitHub user ryanrupp opened a pull request:

    https://github.com/apache/logging-log4j2/pull/9

    [LOG4J2-991] Fixed an issue that the async root logger configuration was...

    ... not defaulting include location to false.
    
    This could happen if async loggers were configured without the use of the 
logger context system property as the logic from LoggerConfig.includeLocation 
was being used instead of AsyncLoggerConfig.includeLocation

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ryanrupp/logging-log4j2 LOG4J2-991

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/logging-log4j2/pull/9.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #9
    
----
commit 357caceb1246eb048aa6d73432eaecdfc6bffa65
Author: Ryan Rupp <ryan.r...@jda.com>
Date:   2015-04-06T16:09:31Z

    [LOG4J2-991] Fixed an issue that the async root logger configuration was 
not defaulting include location to false.
    
    This could happen if async loggers were configured without the use of the 
logger context system property as the logic from LoggerConfig.includeLocation 
was being used instead of AsyncLoggerConfig.includeLocation

----


> Async root logger config is defaulting includeLocation to true without use of 
> Log4jContextSelector system property
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-991
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-991
>             Project: Log4j 2
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Ryan Rupp
>            Priority: Minor
>
> I'm using the approach detailed here - 
> https://logging.apache.org/log4j/2.x/manual/async.html - under "Mixing 
> Synchronous and Asynchronous Loggers" where we have the <asyncRoot> logger 
> defined. I noticed this was slow so looked into it and noticed the location 
> was being captured but I thought this should default to false for async 
> loggers. Looking into this, the line here - 
> https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java#L239
>  - the call to includeLocation() is actually calling 
> LoggerConfig.includeLocation() which checks for the existence of the system 
> property (which we don't have set), therefore include location defaults to 
> true. I think instead it should be calling the includeLocation() static 
> method inside of AsyncLoggerConfig here - 
> https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java#L204
>  - which would end up defaulting this to false correctly as the 
> includeLocation value is actually null since I didn't explicitly configured 
> it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org

Reply via email to