[
https://issues.apache.org/jira/browse/LOG4J2-2272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16378510#comment-16378510
]
Anton Korenkov edited comment on LOG4J2-2272 at 2/27/18 12:45 PM:
------------------------------------------------------------------
I will rephrase my first question. According to this sentence
{quote}
By default, location is not passed to the I/O thread by asynchronous loggers.
If one of your layouts or custom filters needs location information, you need
to set "includeLocation=true" in the configuration of all relevant loggers,
including the root logger.
{quote}
I thought that if we've specified
{{-DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector}}
then location won't be calculated in {{AsyncLogger#calcLocationIfRequested}}
due to false value in includeLocation. However it was true
was (Author: korenkov):
I will rephrase my first question. According to this sentence
{quote}
By default, location is not passed to the I/O thread by asynchronous loggers.
If one of your layouts or custom filters needs location information, you need
to set "includeLocation=true" in the configuration of all relevant loggers,
including the root logger.
{quote}
I thought that if we've specified
{{-DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector}}
then location won't be included in the log message in all possible logging
configurations besides those one, which directly set includeLocation property.
Am I wrong with this assumption?
> includeLocation property for async loggers
> ------------------------------------------
>
> Key: LOG4J2-2272
> URL: https://issues.apache.org/jira/browse/LOG4J2-2272
> Project: Log4j 2
> Issue Type: Question
> Components: Core
> Affects Versions: 2.10.0
> Reporter: Anton Korenkov
> Priority: Minor
>
> According to [link|https://logging.apache.org/log4j/2.0/manual/async.html]:
> {quote}By default,
> [location|https://logging.apache.org/log4j/2.0/manual/async.html#Location] is
> not passed to the I/O thread by asynchronous loggers. If one of your layouts
> or custom filters needs location information, you need to set
> "includeLocation=true" in the configuration of all relevant loggers,
> including the root logger.
> {quote}
> However, if I create logger with default configuration and
> '-DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector'
> vm option 'includeLocation' defaults to 'true'. Is it expected behavior or
> glitch?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)