Commit 71fd3b36 authored by Phillip Webb's avatar Phillip Webb

Update "logging" reference documentation

Update the logging section to reflect changes in Spring Boot 1.2

Fixes gh-1790
parent 119a5656
...@@ -697,9 +697,9 @@ Spring Boot uses http://commons.apache.org/logging[Commons Logging] for all inte ...@@ -697,9 +697,9 @@ Spring Boot uses http://commons.apache.org/logging[Commons Logging] for all inte
logging, but leaves the underlying log implementation open. Default configurations are logging, but leaves the underlying log implementation open. Default configurations are
provided for provided for
http://docs.oracle.com/javase/7/docs/api/java/util/logging/package-summary.html[Java Util Logging], http://docs.oracle.com/javase/7/docs/api/java/util/logging/package-summary.html[Java Util Logging],
http://logging.apache.org/log4j/[Log4J] and http://logging.apache.org/log4j/[Log4J], http://logging.apache.org/log4j/2.x/[Log4J2] and
http://logback.qos.ch/[Logback]. http://logback.qos.ch/[Logback]. In each case loggers are pre-configured to use console
In each case there is console output and file output (rotating, 10 Mb file size). output with optional file output also available.
By default, If you use the '`Starter POMs`', Logback will be used for logging. Appropriate By default, If you use the '`Starter POMs`', Logback will be used for logging. Appropriate
Logback routing is also included to ensure that dependent libraries that use Logback routing is also included to ensure that dependent libraries that use
...@@ -755,13 +755,43 @@ detection. ...@@ -755,13 +755,43 @@ detection.
[[boot-features-logging-file-output]] [[boot-features-logging-file-output]]
=== File output === File output
By default, log files are written to `spring.log` in your `temp` directory and rotate at By default, Spring Boot will only log to the console and will not write log files. If you
10 Mb. You can easily customize the output folder by setting the `logging.path` property want to write log files in addition to the console output you need to set the
(for example in your `application.properties`). It is also possible to change the filename `logging.file` and/or `logging.path` properties (for example in your
using a `logging.file` property. Note that if `logging.file` is used, then setting `logging.path` has no effect. `application.properties`). Log files will rotate when they reach 10 Mb.
As with console output, `ERROR`, `WARN` and `INFO` level messages are logged by default. As with console output, `ERROR`, `WARN` and `INFO` level messages are logged by default.
The following table shows how the `logging.*` properties can be used together:
.Logging properties
[cols="1,1,1,4"]
|===
|logging.path |logging.file |Example |Description
|_(none)_
|Exact location
|`./my.log`
|Writes to the specified file.
|_(none)_
|Simple name
|`my.log`
|Writes the given file in the `temp` folder.
|Specific folder
|Simple name
|`/logs` & `my.log`
|Writes the given file in the specified folder.
|Specific folder
|_(none)_
|`/logs`
|Writes the `spring.log` in the specified folder.
|===
[[boot-features-custom-log-levels]] [[boot-features-custom-log-levels]]
=== Log Levels === Log Levels
...@@ -800,6 +830,9 @@ Depending on your logging system, the following files will be loaded: ...@@ -800,6 +830,9 @@ Depending on your logging system, the following files will be loaded:
|Log4j |Log4j
|`log4j.properties` or `log4j.xml` |`log4j.properties` or `log4j.xml`
|Log4j2
|`log4j2.xml`
|JDK (Java Util Logging) |JDK (Java Util Logging)
|`logging.properties` |`logging.properties`
|=== |===
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment