[
https://issues.apache.org/jira/browse/LOG4J2-184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13618286#comment-13618286
]
Ralph Goers edited comment on LOG4J2-184 at 3/31/13 8:23 AM:
-------------------------------------------------------------
What platform and hardware are you running on? I added the test to Log4j 2 and
ran it. I changed from status=error to status=debug. Here is the output.
Running org.apache.logging.log4j.Log4jInitPerformance
2013-03-31 01:20:18,694 DEBUG Generated plugins in 0.000015000 seconds
2013-03-31 01:20:18,696 DEBUG Generated plugins in 0.000011000 seconds
2013-03-31 01:20:18,696 DEBUG Generated plugins in 0.000009000 seconds
2013-03-31 01:20:18,696 DEBUG Generated plugins in 0.000010000 seconds
2013-03-31 01:20:18,697 DEBUG Generated plugins in 0.000009000 seconds
2013-03-31 01:20:18,697 DEBUG Generated plugins in 0.000009000 seconds
2013-03-31 01:20:18,706 DEBUG Calling createLayout on class
org.apache.logging.log4j.core.layout.PatternLayout for element PatternLayout
with params(pattern="%m%n", Configuration(ConfigTest), null, charset="null")
2013-03-31 01:20:18,706 DEBUG Generated plugins in 0.000012000 seconds
2013-03-31 01:20:18,711 DEBUG Calling createAppender on class
org.apache.logging.log4j.core.appender.ConsoleAppender for element Console with
params(PatternLayout(%m%n), null, target="null", name="STDOUT", follow="null",
suppressExceptions="null")
2013-03-31 01:20:18,712 DEBUG Calling createAppenders on class
org.apache.logging.log4j.core.config.plugins.AppendersPlugin for element
appenders with params(appenders={STDOUT})
2013-03-31 01:20:18,712 DEBUG Generated plugins in 0.000013000 seconds
2013-03-31 01:20:18,713 DEBUG Calling createAppenderRef on class
org.apache.logging.log4j.core.config.AppenderRef for element appender-ref with
params(ref="STDOUT", level="null", null)
2013-03-31 01:20:18,715 DEBUG Calling createLogger on class
org.apache.logging.log4j.core.config.LoggerConfig$RootLogger for element root
with params(additivity="null", level="error",
appender-ref={org.apache.logging.log4j.core.config.AppenderRef@687bc899},
properties={}, Configuration(ConfigTest), null)
2013-03-31 01:20:18,715 DEBUG Calling createLoggers on class
org.apache.logging.log4j.core.config.plugins.LoggersPlugin for element loggers
with params(loggers={root})
log4j 2.0 initialization took 278ms
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.321 sec
was (Author: [email protected]):
What platform and hardware are you running on? I added the test to Log4j 2
and ran it. Here is the output.
Running org.apache.logging.log4j.Log4jInitPerformance
2013-03-31 01:20:18,694 DEBUG Generated plugins in 0.000015000 seconds
2013-03-31 01:20:18,696 DEBUG Generated plugins in 0.000011000 seconds
2013-03-31 01:20:18,696 DEBUG Generated plugins in 0.000009000 seconds
2013-03-31 01:20:18,696 DEBUG Generated plugins in 0.000010000 seconds
2013-03-31 01:20:18,697 DEBUG Generated plugins in 0.000009000 seconds
2013-03-31 01:20:18,697 DEBUG Generated plugins in 0.000009000 seconds
2013-03-31 01:20:18,706 DEBUG Calling createLayout on class
org.apache.logging.log4j.core.layout.PatternLayout for element PatternLayout
with params(pattern="%m%n", Configuration(ConfigTest), null, charset="null")
2013-03-31 01:20:18,706 DEBUG Generated plugins in 0.000012000 seconds
2013-03-31 01:20:18,711 DEBUG Calling createAppender on class
org.apache.logging.log4j.core.appender.ConsoleAppender for element Console with
params(PatternLayout(%m%n), null, target="null", name="STDOUT", follow="null",
suppressExceptions="null")
2013-03-31 01:20:18,712 DEBUG Calling createAppenders on class
org.apache.logging.log4j.core.config.plugins.AppendersPlugin for element
appenders with params(appenders={STDOUT})
2013-03-31 01:20:18,712 DEBUG Generated plugins in 0.000013000 seconds
2013-03-31 01:20:18,713 DEBUG Calling createAppenderRef on class
org.apache.logging.log4j.core.config.AppenderRef for element appender-ref with
params(ref="STDOUT", level="null", null)
2013-03-31 01:20:18,715 DEBUG Calling createLogger on class
org.apache.logging.log4j.core.config.LoggerConfig$RootLogger for element root
with params(additivity="null", level="error",
appender-ref={org.apache.logging.log4j.core.config.AppenderRef@687bc899},
properties={}, Configuration(ConfigTest), null)
2013-03-31 01:20:18,715 DEBUG Calling createLoggers on class
org.apache.logging.log4j.core.config.plugins.LoggersPlugin for element loggers
with params(loggers={root})
log4j 2.0 initialization took 278ms
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.321 sec
> the performance for the log4j initialization needs to be improved
> -----------------------------------------------------------------
>
> Key: LOG4J2-184
> URL: https://issues.apache.org/jira/browse/LOG4J2-184
> Project: Log4j 2
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0-beta4
> Reporter: Andreas Rytina
> Attachments: Log4j2InitializationPerformanceTest.java
>
>
> The initialization of Log4j 2.0 beta4 via an InputStream takes too long. I
> attached an small performance test which reproduces the problem. On my
> machine the test takes approximately one second to complete. On the machine
> at the customer project, I'm currently working on, it's even worse.
> After analyzing this, I found out that the method
> org.apache.logging.log4j.core.config.plugins.PluginManager.collectPlugins()
> is called way to often which consumes most time of the initialization!
--
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: [email protected]
For additional commands, e-mail: [email protected]