[logback-dev] [JIRA] Updates for LOGBACK-1759: LoggerContext.reset() closes Jansi-OutputStream
logback developers list
logback-dev at qos.ch
Mon Jul 17 12:45:00 CEST 2023
logback / LOGBACK-1759 [Open]
LoggerContext.reset() closes Jansi-OutputStream
==============================
Here's what changed in this issue in the last few minutes.
This issue has been created
This issue is now assigned to you.
View or comment on issue using this link
https://jira.qos.ch/browse/LOGBACK-1759
==============================
Issue created
------------------------------
Wolfgang F. Riedl created this issue on 17/Jul/23 12:34
Summary: LoggerContext.reset() closes Jansi-OutputStream
Issue Type: Bug
Affects Versions: 1.3.8
Assignee: Logback dev list
Components: logback-core
Created: 17/Jul/23 12:34
Environment:
h1. Description
For my tests, I am reloading my Logback configuration via the following code snippet:
{code:java}
loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory
configurator = new JoranConfigurator()
configurator.setContext(loggerContext)
loggerContext.reset()
configurator.doConfigure(runResourcesPath.resolve("path.xml").toFile) {code}
However, a call to loggerContext.reset() will, if configured with Jansi, call close() on the OutputStream of a ConsoleAppender (c.f. OutputStreamAppender.closeOutputStream()). This will prevent any more writing being done to this stream (i.e. the Jansi stream).
h1. 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.
h1. Environment
* Logback: 1.3.7 and 1.3.8
* Jansi: 1.8 and 2.4.0
* Java: 1.8 and 11
* Windows 10
Priority: Critical
Reporter: Wolfgang F. Riedl
==============================
This message was sent by Atlassian Jira (v9.6.0#960000-sha1:a3ee8af)
More information about the logback-dev
mailing list