Skip to content

Log4j writes certain errors to System.out instead of System.err #1484

Closed
@hblohm

Description

@hblohm

When using log4j (tried 2.17.0 and 2.20.0) it initializes StackLocator that writes a warning to System.out when not finding sun.reflect.Reflection.getCallerClass - which is true for Java versions >= 9 I believe.

This pretty much invalidates the use of log4j in a java command line that produces binary output that gets stream for further processing. While text output could possibly be suitably filtered, for binary output that is really unusable.

It would be great, if that output could be dropped or at least sent to System.err (like regular log output).

Any workaround would be greatly appreciated!

Thanks,
Henning

Metadata

Metadata

Assignees

Labels

bugIncorrect, unexpected, or unintended behavior of existing code

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions