diff --git a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index 841c787b78..a16f0991df 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -257,7 +257,7 @@ content into your application; rather pick only the properties that you need. spring.data.rest.base-uri= # base URI against which the exporter should calculate its links # FLYWAY ({sc-spring-boot-autoconfigure}/flyway/FlywayProperties.{sc-ext}[FlywayProperties]) - flyway.locations=classpath:db/migrations # locations of migrations scripts + flyway.locations=classpath:db/migration # locations of migrations scripts flyway.schemas= # schemas to update flyway.init-version= 1 # version to start migration flyway.sql-migration-prefix=V diff --git a/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java b/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java index 745aaa1899..b5fcf92087 100644 --- a/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java +++ b/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java @@ -61,6 +61,29 @@ import org.springframework.util.StringUtils; */ public class LoggingApplicationListener implements SmartApplicationListener { + /** + * The name of the Spring property that contains a reference to the logging + * configuration to load. + */ + public static final String CONFIG_PROPERTY = "logging.config"; + + /** + * The name of the Spring property that contains the path where the logging + * configuration can be found. + */ + public static final String PATH_PROPERTY = "logging.path"; + + /** + * The name of the Spring property that contains the name of the logging configuration + * file. + */ + public static final String FILE_PROPERTY = "logging.file"; + + /** + * The name of the System property that contains the process ID. + */ + public static final String PID_KEY = "PID"; + private static MultiValueMap LOG_LEVEL_LOGGERS; static { LOG_LEVEL_LOGGERS = new LinkedMultiValueMap(); @@ -115,8 +138,8 @@ public class LoggingApplicationListener implements SmartApplicationListener { * {@link Environment} and the classpath. */ protected void initialize(ConfigurableEnvironment environment, ClassLoader classLoader) { - if (System.getProperty("PID") == null) { - System.setProperty("PID", new ApplicationPid().toString()); + if (System.getProperty(PID_KEY) == null) { + System.setProperty(PID_KEY, new ApplicationPid().toString()); } initializeEarlyLoggingLevel(environment); LoggingSystem system = LoggingSystem.get(classLoader); @@ -138,7 +161,7 @@ public class LoggingApplicationListener implements SmartApplicationListener { private void initializeSystem(ConfigurableEnvironment environment, LoggingSystem system) { String logFile = getLogFile(environment); - String logConfig = environment.getProperty("logging.config"); + String logConfig = environment.getProperty(CONFIG_PROPERTY); if (StringUtils.hasLength(logConfig)) { try { ResourceUtils.getURL(logConfig).openStream().close(); @@ -157,8 +180,8 @@ public class LoggingApplicationListener implements SmartApplicationListener { } private String getLogFile(ConfigurableEnvironment environment) { - String file = environment.getProperty("logging.file"); - String path = environment.getProperty("logging.path"); + String file = environment.getProperty(FILE_PROPERTY); + String path = environment.getProperty(PATH_PROPERTY); if (StringUtils.hasLength(path) || StringUtils.hasLength(file)) { if (!StringUtils.hasLength(file)) { file = "spring.log";