Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
c9a3919a
Commit
c9a3919a
authored
Dec 05, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add LoggingApplicationListener constants
Extract some of the common property keys as constants. Fixes gh-2068
parent
f65c7dbe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
5 deletions
+26
-5
LoggingApplicationListener.java
...ingframework/boot/logging/LoggingApplicationListener.java
+26
-5
No files found.
spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java
View file @
c9a3919a
...
@@ -73,13 +73,34 @@ public class LoggingApplicationListener implements SmartApplicationListener {
...
@@ -73,13 +73,34 @@ public class LoggingApplicationListener implements SmartApplicationListener {
private
static
final
Map
<
String
,
String
>
ENVIRONMENT_SYSTEM_PROPERTY_MAPPING
;
private
static
final
Map
<
String
,
String
>
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"
;
public
static
final
String
PID_KEY
=
"PID"
;
static
{
static
{
ENVIRONMENT_SYSTEM_PROPERTY_MAPPING
=
new
HashMap
<
String
,
String
>();
ENVIRONMENT_SYSTEM_PROPERTY_MAPPING
=
new
HashMap
<
String
,
String
>();
ENVIRONMENT_SYSTEM_PROPERTY_MAPPING
.
put
(
"logging.file"
,
"LOG_FILE"
);
ENVIRONMENT_SYSTEM_PROPERTY_MAPPING
.
put
(
FILE_PROPERTY
,
"LOG_FILE"
);
ENVIRONMENT_SYSTEM_PROPERTY_MAPPING
.
put
(
"logging.path"
,
"LOG_PATH"
);
ENVIRONMENT_SYSTEM_PROPERTY_MAPPING
.
put
(
PATH_PROPERTY
,
"LOG_PATH"
);
ENVIRONMENT_SYSTEM_PROPERTY_MAPPING
.
put
(
PID_KEY
,
PID_KEY
);
ENVIRONMENT_SYSTEM_PROPERTY_MAPPING
.
put
(
"PID"
,
PID_KEY
);
}
}
private
static
MultiValueMap
<
LogLevel
,
String
>
LOG_LEVEL_LOGGERS
;
private
static
MultiValueMap
<
LogLevel
,
String
>
LOG_LEVEL_LOGGERS
;
...
@@ -194,8 +215,8 @@ public class LoggingApplicationListener implements SmartApplicationListener {
...
@@ -194,8 +215,8 @@ public class LoggingApplicationListener implements SmartApplicationListener {
private
void
initializeSystem
(
ConfigurableEnvironment
environment
,
private
void
initializeSystem
(
ConfigurableEnvironment
environment
,
LoggingSystem
system
)
{
LoggingSystem
system
)
{
if
(
environment
.
containsProperty
(
"logging.config"
))
{
if
(
environment
.
containsProperty
(
CONFIG_PROPERTY
))
{
String
value
=
environment
.
getProperty
(
"logging.config"
);
String
value
=
environment
.
getProperty
(
CONFIG_PROPERTY
);
try
{
try
{
ResourceUtils
.
getURL
(
value
).
openStream
().
close
();
ResourceUtils
.
getURL
(
value
).
openStream
().
close
();
system
.
initialize
(
value
);
system
.
initialize
(
value
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment