From f65c7dbeb333fe7063a56b444ee460a62253fe95 Mon Sep 17 00:00:00 2001 From: kakawait Date: Thu, 4 Dec 2014 23:25:42 +0100 Subject: [PATCH 1/2] Update 'flyway.locations' appendix documentation Replace `classpath:db/migrations` with `classpath:db/migrations`. Fixes gh-2063 --- .../src/main/asciidoc/appendix-application-properties.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f313da95ad..25663bbd46 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -223,7 +223,7 @@ content into your application; rather pick only the properties that you need. # 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 From c9a3919af9f9c9c7f0f192daf8682cfc445dd0f6 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Fri, 5 Dec 2014 10:14:38 -0800 Subject: [PATCH 2/2] Add LoggingApplicationListener constants Extract some of the common property keys as constants. Fixes gh-2068 --- .../logging/LoggingApplicationListener.java | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) 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 cc066df31b..29f56931d6 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 @@ -73,13 +73,34 @@ public class LoggingApplicationListener implements SmartApplicationListener { private static final Map ENVIRONMENT_SYSTEM_PROPERTY_MAPPING; + /** + * 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"; static { ENVIRONMENT_SYSTEM_PROPERTY_MAPPING = new HashMap(); - ENVIRONMENT_SYSTEM_PROPERTY_MAPPING.put("logging.file", "LOG_FILE"); - ENVIRONMENT_SYSTEM_PROPERTY_MAPPING.put("logging.path", "LOG_PATH"); - ENVIRONMENT_SYSTEM_PROPERTY_MAPPING.put(PID_KEY, PID_KEY); + ENVIRONMENT_SYSTEM_PROPERTY_MAPPING.put(FILE_PROPERTY, "LOG_FILE"); + ENVIRONMENT_SYSTEM_PROPERTY_MAPPING.put(PATH_PROPERTY, "LOG_PATH"); + ENVIRONMENT_SYSTEM_PROPERTY_MAPPING.put("PID", PID_KEY); } private static MultiValueMap LOG_LEVEL_LOGGERS; @@ -194,8 +215,8 @@ public class LoggingApplicationListener implements SmartApplicationListener { private void initializeSystem(ConfigurableEnvironment environment, LoggingSystem system) { - if (environment.containsProperty("logging.config")) { - String value = environment.getProperty("logging.config"); + if (environment.containsProperty(CONFIG_PROPERTY)) { + String value = environment.getProperty(CONFIG_PROPERTY); try { ResourceUtils.getURL(value).openStream().close(); system.initialize(value);