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

Marcono1234 commented on LOG4J2-2704:
-------------------------------------

This has been fixed in the latest Log4j versions:
- see https://github.com/apache/logging-log4j2/issues/1484 and linked commits 
which changed it to {{System.err}}
- subsequent commits which eventually changed it to {{StatusLogger}}


But as mentioned in LOG4J2-3593 and other issues about this warning message, 
this warning actually indicates a misconfiguration (most likely shaded JAR 
without {{Multi-Release: true}}), and can break location lookup, not only 
affect performance.

> StackLocator should not print to stdout
> ---------------------------------------
>
>                 Key: LOG4J2-2704
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2704
>             Project: Log4j 2
>          Issue Type: Bug
>    Affects Versions: 2.12.1
>            Reporter: Marcel Hellkamp
>            Priority: Major
>
> The static initialization of {{org.apache.logging.log4j.util.StackLocator}} 
> currently prints warnings directly to {{System.out}} if some functionality is 
> missing from the JRE (e.g. {{"WARNING: sun.reflect.Reflection.getCallerClass 
> is not supported. This will impact performance."}}). This breaks console 
> applications that output actual data to stdout, cannot be disabled and 
> ignores the current logger configuration.
> Please remove this (non-critical) warning, let it honor the actual logger 
> configuration, or at least allow users to disable this warning with a system 
> property switch.
> In general, static initialization of a class should NEVER have side-effects 
> like these. A library should NEVER print to stdout, if not explicitly told to 
> do so. I really have no idea how someone could have thought this is a good 
> idea.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to