[
https://issues.apache.org/jira/browse/LOG4J2-565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13933405#comment-13933405
]
Tiago Cardoso edited comment on LOG4J2-565 at 3/13/14 3:30 PM:
---------------------------------------------------------------
It has also occured to me that it could be something related with the classpath
(unreachable network), so I am limiting the classpath to the /tmp folder:
{panel}
/g6opt/javaapp/fusion/ejre1.6.0_25/bin/java
-Dlog4j.configurationFile=/tmp/log4j2.xml -classpath /tmp -jar /tmp/AppJar.jar
{panel}
so the printed classpath is:
{panel}
Classpath:/tmp/AppJar.jar
{panel}
My log4j2 files is:
{code:xml}
<Configuration>
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="[%d{dd MMM yyyy - HH:mm:ss.SSS}] %p - %m%n"/>
</Console>
<RollingRandomAccessFile name="RollingRandomAccessFile"
fileName="/tmp/teste.log"
filePattern="/tmp/testingLog.PART_%i.gz"
immediateFlush="true">
<PatternLayout>
<Pattern>[%d{dd MMM yyyy - HH:mm:ss.SSS}] %p - %m%n</Pattern>
</PatternLayout>
<Policies>
<SizeBasedTriggeringPolicy size="100 KB"/>
</Policies>
<DefaultRolloverStrategy compressionLevel="1" max="200"/>
</RollingRandomAccessFile>
</Appenders>
<Loggers>
<Root level="trace">
<AppenderRef ref="RollingRandomAccessFile"/>
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
{code}
I've also tested the app in a panda board and Raspery Pi board (with Java 7)
and the log4j2 was tooking 7seconds to load.... (log4j 1.xx was taking about
200ms)
I am starting to think that is something related with the IO but I don't
understand why it requires almost 30 seconds to load.
was (Author: matutano):
It has also occured to me that it could be something related with the classpath
(unreachable network), so I am limiting the classpath to the /tmp folder:
/g6opt/javaapp/fusion/ejre1.6.0_25/bin/java
-Dlog4j.configurationFile=/tmp/log4j2.xml -classpath /tmp -jar /tmp/AppJar.jar
so the printed classpath is:
Classpath:/tmp/AppJar.jar
My log4j2 files is:
<Configuration>
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="[%d{dd MMM yyyy - HH:mm:ss.SSS}] %p - %m%n"/>
</Console>
<RollingRandomAccessFile name="RollingRandomAccessFile"
fileName="/tmp/teste.log"
filePattern="/tmp/testingLog.PART_%i.gz"
immediateFlush="true">
<PatternLayout>
<Pattern>[%d{dd MMM yyyy - HH:mm:ss.SSS}] %p - %m%n</Pattern>
</PatternLayout>
<Policies>
<SizeBasedTriggeringPolicy size="100 KB"/>
</Policies>
<DefaultRolloverStrategy compressionLevel="1" max="200"/>
</RollingRandomAccessFile>
</Appenders>
<Loggers>
<Root level="trace">
<AppenderRef ref="RollingRandomAccessFile"/>
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
I've also tested the app in a panda board and Raspery Pi board (with Java 7)
and the log4j2 was tooking 7seconds to load.... (log4j 1.xx was taking about
200ms)
I am starting to think that is something related with the IO but I don't
understand why it requires almost 30 seconds to load.
> Log4j2 loading time
> -------------------
>
> Key: LOG4J2-565
> URL: https://issues.apache.org/jira/browse/LOG4J2-565
> Project: Log4j 2
> Issue Type: Bug
> Components: API
> Affects Versions: 2.0-rc1
> Environment: Using ejre1.6.0_25 in an ARM926EJ-S rev 5 (v5l)
> Reporter: Tiago Cardoso
>
> Everything runs fine on the Desktop computer, but the embedded system
> struggles to obtain the Logger.
> It takes 17 seconds just to run this line:
> Logger logger = LogManager.getLogger("testLogger");
> The classpath is empty and the whole applications is just:
> public static void main(String[] arg){
> System.out.println("Starting application:" + System.currentTimeMillis());
> Logger logger = LogManager.getLogger("testLogger");
> logger.trace("Going to leave application." + System.currentTimeMillis());
> System.exit(1);
> }
> The same system is able to run a client graphic application without this kind
> of event.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]