Author: rpopma
Date: Thu May 2 12:17:24 2013
New Revision: 1478344
URL: http://svn.apache.org/r1478344
Log:
updated Location section to be in line with layouts page Location Information
section
Modified:
logging/log4j/log4j2/trunk/src/site/xdoc/manual/async.xml
Modified: logging/log4j/log4j2/trunk/src/site/xdoc/manual/async.xml
URL:
http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/site/xdoc/manual/async.xml?rev=1478344&r1=1478343&r2=1478344&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/site/xdoc/manual/async.xml (original)
+++ logging/log4j/log4j2/trunk/src/site/xdoc/manual/async.xml Thu May 2
12:17:24 2013
@@ -456,25 +456,35 @@
</subsection>
<a name="Location" />
<subsection name="Location, location, location...">
- <p>
+ <p>
If one of the layouts is
- configured with a location-related attribute like %line,
- %location, %class or %method, Log4j will take a
snapshot of the
+ configured with a location-related attribute like
+ HTML <a
href="layouts.html#HtmlLocationInfo">locationInfo</a>,
+ or one of the patterns
+ <a href="layouts.html#PatternClass">%C or $class</a>,
+ <a href="layouts.html#PatternFile">%F or %file</a>,
+ <a href="layouts.html#PatternLocation">%l or
%location</a>,
+ <a href="layouts.html#PatternLine">%L or %line</a>,
+ <a href="layouts.html#PatternMethod">%M or %method</a>,
+ Log4j will take a snapshot of the
stack, and walk the stack trace to find the location
information.
+ </p>
+ <p>
This is an expensive operation: 1.3 - 5 times slower for
synchronous loggers. Synchronous loggers wait as
long as possible before they take this stack snapshot.
If no
- location is required, the snapshot will never be taken.
However,
+ location is required, the snapshot will never be taken.
+ </p><p>
+ However,
asynchronous loggers need to make this decision before
passing the
log message to another thread; the location information
will be
lost after that point.
- </p><p>
The performance impact of taking a stack trace snapshot
is even
higher for asynchronous loggers: logging with location
is
4 - 20 times slower than without location.
For this reason, asynchronous loggers and asynchronous
appenders do not include location information by
default.
-
+ </p><p>
You can override the default behaviour in your logger
or asynchronous appender configuration
by specifying