Details
-
Bug
-
Resolution: Unresolved
-
Critical
-
1.3.8
-
None
Description
Description
For my tests, I am reloading my Logback configuration via the following code snippet:
loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory configurator = new JoranConfigurator() configurator.setContext(loggerContext) loggerContext.reset() configurator.doConfigure(runResourcesPath.resolve("path.xml").toFile)
However, a call to loggerContext.reset() will call close() on the OutputStream of a ConsoleAppender (c.f. OutputStreamAppender.closeOutputStream()). If configured with Jansi, this will be the Jansi stream which will now be closed. This will prevent any more writing being done to this stream (i.e. the Jansi stream), e.g., if we are reloading Logback to point to a different console.
Expected Behaviour
On loggerContext.reset(), a ConsoleAppender configured with Jansi should not close its output stream (as this is the Jansi stream). If configured without Jansi the stream can be closed without problems.
Environment
- Logback: 1.3.7 and 1.3.8
- Jansi: 1.8 and 2.4.0
- Java: 1.8 and 11
- Windows 10