Skip to content

Commit

Permalink
Fix stderr to also be captured by log4j (#51569)
Browse files Browse the repository at this point in the history
In #50259 we redirected stdout and stderr to log4j, to capture jdk
and external library messages. However, a typo in the method name used
to redirect the stream in java means stdout is currently being
duplicated twice, and stderr not captured. This commit corrects that
mistake. Unfortunately this is at a level that cannot really be tested,
thus we are still missing tests for this behavior.
  • Loading branch information
rjernst committed Jan 30, 2020
1 parent 4f214d2 commit cf5a226
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public FileVisitResult visitFile(final Path file, final BasicFileAttributes attr
// third party libraries may do that
System.setOut(new PrintStream(new LoggingOutputStream(LogManager.getLogger("stdout"), Level.INFO),
false, StandardCharsets.UTF_8.name()));
System.setOut(new PrintStream(new LoggingOutputStream(LogManager.getLogger("stderr"), Level.WARN),
System.setErr(new PrintStream(new LoggingOutputStream(LogManager.getLogger("stderr"), Level.WARN),
false, StandardCharsets.UTF_8.name()));
}

Expand Down

0 comments on commit cf5a226

Please sign in to comment.