[
https://issues.apache.org/jira/browse/LOG4J2-658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14106656#comment-14106656
]
Remko Popma commented on LOG4J2-658:
------------------------------------
Romain, can I clarify again what you are trying to achieve? If I understand
correctly, the reason you were trying to route TomcatEE logging to log4j2 is to
investigate whether it is possible to use a different logging API than commons
logging, and integration the JCache logging with the container logging, am I
correct? So, you were investigating migrating JCache to log4j2? Or migrating
TomcatEE to log4j2?
You routed all TomcatEE container logging to log4j2. That worked except that
the log4j2 shutdown hook was not disabled and log messages during the shutdown
sequence were lost. As Ralph mentioned, one solution is to create a jar that
only contains a log4j2.component.properties file whose contents is
log4j.shutdownHookEnabled=false.
I am sure we would all like other Apache projects to use log4j2 and are willing
to make changes to facilitate that, but I don't think building something
fragile in log4j2 is the best solution. Perhaps it would be better to include
some of the Tomcat/TomcatEE people in this conversation?
> shutdown hook called too early
> ------------------------------
>
> Key: LOG4J2-658
> URL: https://issues.apache.org/jira/browse/LOG4J2-658
> Project: Log4j 2
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0-rc1, 2.0-rc2, 2.0.2
> Reporter: Romain Manni-Bucau
> Assignee: Matt Sicker
>
> Hi
> this issue follow few mail exchanges from the commons list. Here the
> interesting part for log4j2:
> {quote}
> Here what I do (we can move it to another thread since that's 100% log4j2
> related):
> unzip apache-tomee-1.7.0-SNAPSHOT-webprofile.zip &&
> cd apache-tomee-webprofile-1.7.0-SNAPSHOT/ &&
> rm conf/logging.properties &&
> echo 'openejb.log.factory=log4j'>conf/system.properties &&
> cp ~/log4j2.xml conf/log4j2.xml &&
> cp
> ~/.m2/repository/org/apache/logging/log4j/log4j-api/2.0-rc2-SNAPSHOT/log4j-api-2.0-rc2-SNAPSHOT.jar
> lib/ &&
> cp
> ~/.m2/repository/org/apache/logging/log4j/log4j-core/2.0-rc2-SNAPSHOT/log4j-core-2.0-rc2-SNAPSHOT.jar
> lib/ &&
> cp
> ~/.m2/repository/org/apache/logging/log4j/log4j-1.2-api/2.0-rc2-SNAPSHOT/log4j-1.2-api-2.0-rc2-SNAPSHOT.jar
> lib/ &&
> ./bin/catalina.sh
> it makes server starting with log4j2 logs, if you ctrl+c logs are not
> printed. Sure it is cause context is closed too early and then loggers have
> NullConfiguration. (If I debug in java.lang.ApplicationShutdownHooks#runHooks
> to wait all hooks exec it works)
> {quote}
> Basically the issue is that when shutting down with ctrl+C some logs are
> swallowed.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]