You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Remko Popma (Jira)" <ji...@apache.org> on 2020/06/15 07:48:00 UTC

[jira] [Updated] (LOG4J2-2869) Default status logger destination should be STDERR, not STDOUT

     [ https://issues.apache.org/jira/browse/LOG4J2-2869?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma updated LOG4J2-2869:
--------------------------------
    Description: 
Currently, the default status logging destination for internal Log4j logging is the standard output stream. This is problematic for command line tools whose output is processed by other processes. The default destination for Log4j internal logging should be STDERR.

Note that initially (before the configuration is processed) the status logger actually does output to STDERR, but once the configuration is processed, the {{StatusLogger}} starts to delegate to the {{StatusListeners}}, and the {{StatusConsoleListener}} that is installed by the  {{StatusConfiguration}} has their {{DEFAULT_STREAM}} set to {{System.out}}. I believe this is an oversight and the intention has always been for internal status logging to go to {{System.err}}.

As a workaround, applications can explicitly configure the destination with the {{dest}} attribute:

{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="error" dest="err">
...
{code}




  was:
Currently, the default status logging destination for internal Log4j logging is the standard output stream. This is problematic for command line tools whose output is processed by other processes. The default destination for Log4j internal logging should be STDERR.

Note that initially (before the configuration is processed) the status logger actually does output to STDERR, but once the configuration is processed, the {{StatusLogger}} starts to delegate to the {{StatusListeners}}, and the {{StatusConsoleListener}} that is installed by the  {{StatusConfiguration}} has their {{DEFAULT_STREAM}} set to {{System.out}}. I believe this is an oversight and the intention has always been for internal status logging to go to {{System.err}}.




> Default status logger destination should be STDERR, not STDOUT
> --------------------------------------------------------------
>
>                 Key: LOG4J2-2869
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2869
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Configuration
>    Affects Versions: 2.13.3
>            Reporter: Remko Popma
>            Priority: Major
>
> Currently, the default status logging destination for internal Log4j logging is the standard output stream. This is problematic for command line tools whose output is processed by other processes. The default destination for Log4j internal logging should be STDERR.
> Note that initially (before the configuration is processed) the status logger actually does output to STDERR, but once the configuration is processed, the {{StatusLogger}} starts to delegate to the {{StatusListeners}}, and the {{StatusConsoleListener}} that is installed by the  {{StatusConfiguration}} has their {{DEFAULT_STREAM}} set to {{System.out}}. I believe this is an oversight and the intention has always been for internal status logging to go to {{System.err}}.
> As a workaround, applications can explicitly configure the destination with the {{dest}} attribute:
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration status="error" dest="err">
> ...
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)