@@ -73,13 +73,34 @@ public class LoggingApplicationListener implements SmartApplicationListener {
73
73
74
74
private static final Map <String , String > ENVIRONMENT_SYSTEM_PROPERTY_MAPPING ;
75
75
76
+ /**
77
+ * The name of the Spring property that contains a reference to the logging
78
+ * configuration to load.
79
+ */
80
+ public static final String CONFIG_PROPERTY = "logging.config" ;
81
+
82
+ /**
83
+ * The name of the Spring property that contains the path where the logging
84
+ * configuration can be found.
85
+ */
86
+ public static final String PATH_PROPERTY = "logging.path" ;
87
+
88
+ /**
89
+ * The name of the Spring property that contains the name of the logging configuration
90
+ * file.
91
+ */
92
+ public static final String FILE_PROPERTY = "logging.file" ;
93
+
94
+ /**
95
+ * The name of the System property that contains the process ID.
96
+ */
76
97
public static final String PID_KEY = "PID" ;
77
98
78
99
static {
79
100
ENVIRONMENT_SYSTEM_PROPERTY_MAPPING = new HashMap <String , String >();
80
- ENVIRONMENT_SYSTEM_PROPERTY_MAPPING .put ("logging.file" , "LOG_FILE" );
81
- ENVIRONMENT_SYSTEM_PROPERTY_MAPPING .put ("logging.path" , "LOG_PATH" );
82
- ENVIRONMENT_SYSTEM_PROPERTY_MAPPING .put (PID_KEY , PID_KEY );
101
+ ENVIRONMENT_SYSTEM_PROPERTY_MAPPING .put (FILE_PROPERTY , "LOG_FILE" );
102
+ ENVIRONMENT_SYSTEM_PROPERTY_MAPPING .put (PATH_PROPERTY , "LOG_PATH" );
103
+ ENVIRONMENT_SYSTEM_PROPERTY_MAPPING .put ("PID" , PID_KEY );
83
104
}
84
105
85
106
private static MultiValueMap <LogLevel , String > LOG_LEVEL_LOGGERS ;
@@ -194,8 +215,8 @@ private boolean mapSystemPropertiesFromSpring(Environment environment) {
194
215
195
216
private void initializeSystem (ConfigurableEnvironment environment ,
196
217
LoggingSystem system ) {
197
- if (environment .containsProperty ("logging.config" )) {
198
- String value = environment .getProperty ("logging.config" );
218
+ if (environment .containsProperty (CONFIG_PROPERTY )) {
219
+ String value = environment .getProperty (CONFIG_PROPERTY );
199
220
try {
200
221
ResourceUtils .getURL (value ).openStream ().close ();
201
222
system .initialize (value );
0 commit comments