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

Robert Ross commented on LOG4J2-2484:
-------------------------------------

Thanks for the clarification on use case.  Let's try this:

_I have an application with a user base which needs to effectively be able to 
separate StatusLogger trace messages from real error messages which are going 
to STDERR.  The users would like to gather all StatusLogger messages in a 
single location or stream so that they can clearly identify logging sources and 
levels of information.  In short, they wish to use Log4J the way it was 
intended.  However, it is recognized that StatusLogger has the "chicken-or-egg" 
issue of having to log messages prior to the Configuration being loaded.  The 
best we can do right now through standard means is to have StatusLogger output 
to STDERR until the Configuration is loaded and they can gain more control.  
This does not address our requirement to gather all StatusLogger information in 
a single destination stream.  To solve this use case, I propose that 
StatusLogger expose the stream bean via the delegation pattern to the 
SimpleLogger already held by the StatusLogger.  This would allow us to 
programmatically redirect the stream to something other than STDERR and avoid 
the complications of a hand-off between the StatusLogger before and after 
Configuration is loaded._

> Allow setting of output stream on StatusLogger
> ----------------------------------------------
>
>                 Key: LOG4J2-2484
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2484
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Robert Ross
>            Priority: Minor
>              Labels: StatusLogger, debugging
>
> The StatusLogger internally uses a SimpleLogger.  SimpleLogger offers the 
> ability to control the output stream, but StatusLogger encapsulates and hides 
> this capability, always using System.err as the output stream.
> It would be useful to expose this option so that the API offers some control 
> over the output stream used by StatusLogger.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to