"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "log4j-core/src/test/java/org/apache/logging/log4j/core/appender/OutputStreamAppenderTest.java" between
apache-log4j-2.11.1-src.tar.gz and apache-log4j-2.11.2-src.tar.gz

About: Apache Log4j 2 is a logging library for Java. Source distribution (Java).

OutputStreamAppenderTest.java  (apache-log4j-2.11.1-src):OutputStreamAppenderTest.java  (apache-log4j-2.11.2-src)
skipping to change at line 96 skipping to change at line 96
* Validates that the code pattern we use to add an appender on the fly * Validates that the code pattern we use to add an appender on the fly
* works with a basic appender that is not the new OutputStream appender or * works with a basic appender that is not the new OutputStream appender or
* new Writer appender. * new Writer appender.
*/ */
@Test @Test
public void testUpdatePatternWithFileAppender() { public void testUpdatePatternWithFileAppender() {
final LoggerContext ctx = (LoggerContext) LogManager.getContext(false); final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
final Configuration config = ctx.getConfiguration(); final Configuration config = ctx.getConfiguration();
// @formatter:off // @formatter:off
final Appender appender = FileAppender.newBuilder() final Appender appender = FileAppender.newBuilder()
.withFileName("target/" + getClass().getName() + ".log") .withFileName("target/" + getClass().getName() + ".log")
.withAppend(false) .withAppend(false).setName("File").setIgnoreExceptions(false)
.withName("File")
.withIgnoreExceptions(false)
.withBufferedIo(false) .withBufferedIo(false)
.withBufferSize(4000) .withBufferSize(4000)
.setConfiguration(config) .setConfiguration(config)
.build(); .build();
// @formatter:on // @formatter:on
appender.start(); appender.start();
config.addAppender(appender); config.addAppender(appender);
ConfigurationTestUtils.updateLoggers(appender, config); ConfigurationTestUtils.updateLoggers(appender, config);
LogManager.getLogger().error("FOO MSG"); LogManager.getLogger().error("FOO MSG");
} }
 End of changes. 1 change blocks. 
4 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)