Fix checkstyle and test for logging output stream
Commit a156629b
didn't quite fix the botched backport. This commit does.
This commit is contained in:
parent
a156629b4a
commit
fbfc5a327c
|
@ -247,8 +247,10 @@ public class LogConfigurator {
|
|||
|
||||
// Redirect stdout/stderr to log4j. While we ensure Elasticsearch code does not write to those streams,
|
||||
// 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), false, StandardCharsets.UTF_8.name()));
|
||||
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),
|
||||
false, StandardCharsets.UTF_8.name()));
|
||||
}
|
||||
|
||||
private static void configureStatusLogger() {
|
||||
|
|
|
@ -53,9 +53,9 @@ public class LoggingOutputStreamTests extends ESTestCase {
|
|||
PrintStream printStream;
|
||||
|
||||
@Before
|
||||
public void createStream() {
|
||||
public void createStream() throws Exception {
|
||||
loggingStream = new TestLoggingOutputStream();
|
||||
printStream = new PrintStream(loggingStream, false, StandardCharsets.UTF_8);
|
||||
printStream = new PrintStream(loggingStream, false, StandardCharsets.UTF_8.name());
|
||||
}
|
||||
|
||||
public void testEmptyLine() {
|
||||
|
|
Loading…
Reference in New Issue