logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remko Popma <remko.po...@gmail.com>
Subject Re: includeLocation = true by default in LoggerConfig
Date Sun, 30 Nov 2014 08:58:33 GMT
IncludeLocation is false by default:

* For synchronous logging, the expensive operation (taking a stack trace
snapshot) is only performed if the pattern configuration needs it (has some
location parameters as you indicated). If the pattern configuration does
not have location parameters then location information is not obtained.

* For asynchronous logging, this works differently. Still, by default
location information is not obtained. The difference with synchronous
logging is that just specifying a pattern with location parameters is not
enough. If you want to log location info, you also need to specify a value
of "includeLocation=true" in the configuration of your async logger or
async appender.

See also:

Best regards,

On Sun, Nov 30, 2014 at 5:29 PM, Yair Ogen (yaogen) <yaogen@cisco.com>

> I am using log4j2.1. any reason this flag is set to true by default? It is
> very expensive (cpu wise) and AFAIK is something usually set by the pattern
> (i.e. display source file and source line).

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message