You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Remko Popma (JIRA)" <ji...@apache.org> on 2013/04/28 21:58:15 UTC

[jira] [Resolved] (LOG4J2-225) Improve documentation on use of location in pattern layouts

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

Remko Popma resolved LOG4J2-225.
--------------------------------

    Resolution: Fixed

Fixed in revision 1476820.

Changed most sample pattern layouts that used %C to %c.
I did not change the sample layout patterns that had %C %M, but added comment in the config XML.

Appenders page: clarified that the default for immediateFlush is true.

Layouts page: added a new section Location Information.
Also added a paragraph to all location-related patterns. For example, class name: "Generating the class name of the caller is an expensive operation and may impact performance. Use with caution."

Flow Tracing page: added comment in config XML.

Affected files:
src/site/site.xml
src/site/xdoc/manual/appenders.xml
src/site/xdoc/manual/async.xml
src/site/xdoc/manual/configuration.xml.vm
src/site/xdoc/manual/filters.xml
src/site/xdoc/manual/flowtracing.xml
src/site/xdoc/manual/layouts.xml.vm
src/site/xdoc/manual/lookups.xml

Please review.
                
> Improve documentation on use of location in pattern layouts
> -----------------------------------------------------------
>
>                 Key: LOG4J2-225
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-225
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 2.0-beta5
>            Reporter: Remko Popma
>             Fix For: 2.0-beta6
>
>
> I think the sample configurations should avoid using location-based layouts like %C, %M, %location etc. 
> That is, unless the sample demonstrates the location-based capabilities, of course. 
> The performance impact of location-based layouts is quite large (something like 5x slower), and I'd hate to give people the first impression that log4j2 is slow because of our own example configs... 
> Here is the sample File configuration in http://logging.apache.org/log4j/2.x/manual/appenders.html#FileAppender with my proposed changes: 
>     <?xml version="1.0" encoding="UTF-8"?> 
>     <configuration status="warn" name="MyApp" packages=""> 
>     <appenders> 
>     <File name="MyFile" fileName="logs/app.log">
>     <PatternLayout> 
>     <pattern>%d %p %c{1.} [%t] %m%n</pattern> <!-- avoid location %C in examples --> 
>     </PatternLayout> 
>     </File> 
>     </appenders> 
>     <loggers> 
>     <root level="error">
>     <appender-ref ref="MyFile"/> 
>     </root> 
>     </loggers> 
>     </configuration>
> As per discussion on the dev mailing list, there should also be a section heading somewhere called Location Information that specifically identifies each of the location patterns and discusses the overhead of each.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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