Tom created LOG4J2-1652:
---------------------------
Summary: Shutdown only works correctly once
Key: LOG4J2-1652
URL: https://issues.apache.org/jira/browse/LOG4J2-1652
Project: Log4j 2
Issue Type: Bug
Affects Versions: 2.7, 2.6.2
Environment: Java 8
Reporter: Tom
I am trying to reset log4j via the following code at runtime in order to write
to new logfiles in newly specified directory.
{code:title=|borderStyle=solid}
final LoggerContext context = (org.apache.logging.log4j.core.LoggerContext)
LogManager.getContext(false);
Configurator.shutdown(context);
// Init and reset
Configurator.initialize("", logConfigFile);
context.setConfigLocation(file.toURI());
{code}
Unfortunately, this only works once correctly. After the second shutdown, new
logging files are created but the output is still written to the old files.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]