LoggingApplicationListener
An ApplicationListener that configures the LoggingSystem. If the environment contains a logging.config
property it will be used to bootstrap the logging system, otherwise a default configuration is used. Regardless, logging levels will be customized if the environment contains logging.level.*
entries and logging groups can be defined with logging.group
.
Debug and trace logging for Spring, Tomcat, Jetty and Hibernate will be enabled when the environment contains debug
or trace
properties that aren't set to "false"
(i.e. if you start your application using java -jar myapp.jar [--debug | --trace]). If you prefer to ignore these properties you can set parseArgs to false
.
By default, log output is only written to the console. If a log file is required, the logging.file.path
and logging.file.name
properties can be used.
Some system properties may be set as side effects, and these can be useful if the logging configuration supports placeholders (i.e. log4j or logback):
LOG_FILE
is set to the value of path of the log file that should be written (if any).PID
is set to the value of the current process ID if it can be determined.
Author
Dave Syer
Phillip Webb
Andy Wilkinson
Madhura Bhave
HaiTao Zhang
Since
2.0.0