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

Bruce Brouwer commented on LOG4J2-609:
--------------------------------------

Why should the {{StatusData}} constructor be public (other than it is a small 
breaking API change)? Nothing should be creating these {{StatusData}} objects 
other than {{StatusLogger}}.

The only thing that ever registered {{StatusConsoleListener}} was 
{{JsonConfiguration}} or {{XmlConfiguration}}, both of which are in -core. So 
if someone only included log4j-api, the behavior now will be the same now as 
before. Well, I suppose it is a little different than before. Before, the 
default level was FATAL, so {{StatusLogger.getLogger().isEnabled(Level.FATAL, 
null)}} would return true, even though it wouldn't actually do anything when 
{{.fatal("some error")}} was called. 

Now, I did like the suggestion that Matt made where perhaps sending 
{{StatusLogger}} output to {{System.out}} or {{System.err}} should have nothing 
to do with {{JsonConfiguration}} or {{XmlConfiguration}}, but rather should be 
configured from the Log4j properties. I would be on board with that change as 
long as we rip out that configuration from {{JsonConfiguration}} and 
{{XmlConfiguration}}. This way if I only included log4j-api, I could still get 
some messages to show on {{System.out}}. 

I actually would like this change very much. Right now, nothing will ever 
remove that {{StatusConsoleListener}}. With changing this to use Log4j 
properties, nobody would expect the ability to turn off {{StatusLogger}} output 
to {{System.out}}. In fact, I probably wouldn't even implement this as a 
{{StatusListener}}, but rather directly inside {{StatusLogger}}. 

What do you say to that?



> 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