Merge branch '1.3.x'

This commit is contained in:
Andy Wilkinson 2016-02-11 19:40:04 +00:00
commit 2cee11620e
3 changed files with 9 additions and 7 deletions

View File

@ -120,17 +120,17 @@ public class LoggingApplicationListener implements GenericApplicationListener {
public static final String LOG_PATH = "LOG_PATH"; public static final String LOG_PATH = "LOG_PATH";
/** /**
* The name of the System property that contains the console log pattern * The name of the System property that contains the console log pattern.
*/ */
public static final String CONSOLE_LOG_PATTERN = "CONSOLE_LOG_PATTERN"; public static final String CONSOLE_LOG_PATTERN = "CONSOLE_LOG_PATTERN";
/** /**
* The name of the System property that contains the file log pattern * The name of the System property that contains the file log pattern.
*/ */
public static final String FILE_LOG_PATTERN = "FILE_LOG_PATTERN"; public static final String FILE_LOG_PATTERN = "FILE_LOG_PATTERN";
/** /**
* The name of the System property that contains the log level pattern * The name of the System property that contains the log level pattern.
*/ */
public static final String LOG_LEVEL_PATTERN = "LOG_LEVEL_PATTERN"; public static final String LOG_LEVEL_PATTERN = "LOG_LEVEL_PATTERN";

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2014 the original author or authors. * Copyright 2012-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -62,7 +62,9 @@ public abstract class AbstractLoggingSystemTests {
} }
protected final LogFile getLogFile(String file, String path) { protected final LogFile getLogFile(String file, String path) {
return new LogFile(file, path); LogFile logFile = new LogFile(file, path);
logFile.applyToSystemProperties();
return logFile;
} }
protected final String tmpDir() { protected final String tmpDir() {

View File

@ -415,7 +415,7 @@ public class LoggingApplicationListenerTests {
@Test @Test
public void systemPropertiesAreSetForLoggingConfiguration() { public void systemPropertiesAreSetForLoggingConfiguration() {
EnvironmentTestUtils.addEnvironment(this.context, EnvironmentTestUtils.addEnvironment(this.context,
"logging.exception-conversion-word=conversion", "logging.file=file", "logging.exception-conversion-word=conversion", "logging.file=target/log",
"logging.path=path", "logging.pattern.console=console", "logging.path=path", "logging.pattern.console=console",
"logging.pattern.file=file", "logging.pattern.level=level"); "logging.pattern.file=file", "logging.pattern.level=level");
this.initializer.initialize(this.context.getEnvironment(), this.initializer.initialize(this.context.getEnvironment(),
@ -424,7 +424,7 @@ public class LoggingApplicationListenerTests {
assertThat(System.getProperty("FILE_LOG_PATTERN")).isEqualTo("file"); assertThat(System.getProperty("FILE_LOG_PATTERN")).isEqualTo("file");
assertThat(System.getProperty("LOG_EXCEPTION_CONVERSION_WORD")) assertThat(System.getProperty("LOG_EXCEPTION_CONVERSION_WORD"))
.isEqualTo("conversion"); .isEqualTo("conversion");
assertThat(System.getProperty("LOG_FILE")).isEqualTo("file"); assertThat(System.getProperty("LOG_FILE")).isEqualTo("target/log");
assertThat(System.getProperty("LOG_LEVEL_PATTERN")).isEqualTo("level"); assertThat(System.getProperty("LOG_LEVEL_PATTERN")).isEqualTo("level");
assertThat(System.getProperty("LOG_PATH")).isEqualTo("path"); assertThat(System.getProperty("LOG_PATH")).isEqualTo("path");
assertThat(System.getProperty("PID")).isNotNull(); assertThat(System.getProperty("PID")).isNotNull();