[ 
https://issues.apache.org/jira/browse/LOG4J2-609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14062129#comment-14062129
 ] 

Remko Popma commented on LOG4J2-609:
------------------------------------

I would prefer to leave the {{StatusData}} constructor as it is. If we want to 
make a change we could add another constructor.

The proposed {{StatusLogger.isEnabled()} method returns false if there are no 
listeners. Now that the console listener is moving to core, what happens if a 
user only has the log4j-api module on the classpath? Does this mean that there 
will be no listeners and StatusLogger will not output anything for code that 
looks like this:
{code}
if (StatusLogger.getLogger().isEnabled(Level.ERROR, null)) { // returns false
    StatusLogger.getLogger().error("some error");
}
{code}
Would it be an idea to remove the check for the presence of listeners in 
{{isEnabled()}?

> StatusConfiguration doesn't close files
> ---------------------------------------
>
>                 Key: LOG4J2-609
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-609
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0-rc1
>            Reporter: Bruce Brouwer
>            Assignee: Ralph Goers
>         Attachments: LOG4J2-609.unfinished.patch, log4j2-609.patch
>
>
> {{org.apache.logging.log4j.core.config.status.StatusConfiguration}} allows 
> you to specify a destination such as "out", "err" or a file name. If 
> specifying a file, that file stream is used when creating a 
> {{StatusConsoleListener}} that is added to the {{StatusLogger}}. Those 
> {{StatusLogger}} listeners are never cleaned up when, for example, the 
> {{XmlConfiguration}} is reconfigured or when the {{LoggerContext}} is shut 
> down (e.g. in {{InitialLoggerContext.apply()}}). This leaves open file 
> handles and is the source of the failing test {{FileOutputTest}} on Windows. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to