This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch release/2.21.0
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit df092d0b5046245c81e35fa3dae5a9f667386dcd
Author: Volkan Yazıcı <[email protected]>
AuthorDate: Thu Oct 5 14:10:38 2023 +0200

    Replaced the usage of `System.out` in `StackLocator` with `System.err` 
(#1484)
---
 .../apache/logging/log4j/util/StackLocator.java    |  4 ++--
 .../.2.x.x/1484_fix_StackLocator_stdout.xml        | 26 ++++++++++++++++++++++
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git 
a/log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocator.java 
b/log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocator.java
index bf285d1403..d738f32a87 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocator.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocator.java
@@ -72,12 +72,12 @@ public final class StackLocator {
             } else {
                 o = getCallerClassMethod.invoke(null, 1);
                 if (o == sunReflectionClass) {
-                    System.out.println("WARNING: Unexpected result from 
sun.reflect.Reflection.getCallerClass(int), adjusting offset for future 
calls.");
+                    System.err.println("WARNING: Unexpected result from 
sun.reflect.Reflection.getCallerClass(int), adjusting offset for future 
calls.");
                     java7u25CompensationOffset = 1;
                 }
             }
         } catch (final Exception | LinkageError e) {
-            System.out.println("WARNING: sun.reflect.Reflection.getCallerClass 
is not supported. This will impact performance.");
+            System.err.println("WARNING: sun.reflect.Reflection.getCallerClass 
is not supported. This will impact performance.");
             getCallerClassMethod = null;
             java7u25CompensationOffset = -1;
         }
diff --git a/src/changelog/.2.x.x/1484_fix_StackLocator_stdout.xml 
b/src/changelog/.2.x.x/1484_fix_StackLocator_stdout.xml
new file mode 100644
index 0000000000..02081bc830
--- /dev/null
+++ b/src/changelog/.2.x.x/1484_fix_StackLocator_stdout.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to you under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xmlns="http://logging.apache.org/log4j/changelog";
+       xsi:schemaLocation="http://logging.apache.org/log4j/changelog 
https://logging.apache.org/log4j/changelog-0.1.0.xsd";
+       type="fixed">
+  <issue id="1484" 
link="https://github.com/apache/logging-log4j2/issues/1484"/>
+  <author id="github:hblohm" name="Henning Blohm"/>
+  <author id="github:vy"/>
+  <description format="asciidoc">Replaced the usage of `System.out` in 
`StackLocator` for warnings with `System.err`</description>
+</entry>

Reply via email to