logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan Rupp (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LOG4J2-991) Async root logger config is defaulting includeLocation to true without use of Log4jContextSelector system property
Date Mon, 06 Apr 2015 15:27:12 GMT

     [ https://issues.apache.org/jira/browse/LOG4J2-991?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ryan Rupp updated LOG4J2-991:
-----------------------------
    Description: 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.  (was: 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> appender 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.)

> 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-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message