@@ -697,9 +697,9 @@ Spring Boot uses http://commons.apache.org/logging[Commons Logging] for all inte
697697logging, but leaves the underlying log implementation open. Default configurations are
698698provided for
699699http://docs.oracle.com/javase/7/docs/api/java/util/logging/package-summary.html[Java Util Logging],
700- http://logging.apache.org/log4j/[Log4J] and
701- http://logback.qos.ch/[Logback].
702- In each case there is console output and file output (rotating, 10 Mb file size) .
700+ http://logging.apache.org/log4j/[Log4J], http://logging.apache.org/log4j/2.x/[Log4J2] and
701+ http://logback.qos.ch/[Logback]. In each case loggers are pre-configured to use console
702+ output with optional file output also available .
703703
704704By default, If you use the '`Starter POMs`', Logback will be used for logging. Appropriate
705705Logback routing is also included to ensure that dependent libraries that use
@@ -755,13 +755,43 @@ detection.
755755
756756[[boot-features-logging-file-output]]
757757=== File output
758- By default, log files are written to `spring.log` in your `temp` directory and rotate at
759- 10 Mb. You can easily customize the output folder by setting the `logging.path` property
760- (for example in your `application.properties`). It is also possible to change the filename
761- using a `logging.file` property. Note that if `logging.file` is used, then setting `logging.path` has no effect .
758+ By default, Spring Boot will only log to the console and will not write log files. If you
759+ want to write log files in addition to the console output you need to set the
760+ `logging.file` and/or `logging.path` properties (for example in your
761+ `application.properties`). Log files will rotate when they reach 10 Mb .
762762
763763As with console output, `ERROR`, `WARN` and `INFO` level messages are logged by default.
764764
765+ The following table shows how the `logging.*` properties can be used together:
766+
767+ .Logging properties
768+ [cols="1,1,1,4"]
769+ |===
770+ |logging.path |logging.file |Example |Description
771+
772+ |_(none)_
773+ |Exact location
774+ |`./my.log`
775+ |Writes to the specified file.
776+
777+ |_(none)_
778+ |Simple name
779+ |`my.log`
780+ |Writes the given file in the `temp` folder.
781+
782+ |Specific folder
783+ |Simple name
784+ |`/logs` & `my.log`
785+ |Writes the given file in the specified folder.
786+
787+ |Specific folder
788+ |_(none)_
789+ |`/logs`
790+ |Writes the `spring.log` in the specified folder.
791+ |===
792+
793+
794+
765795[[boot-features-custom-log-levels]]
766796=== Log Levels
767797
@@ -800,6 +830,9 @@ Depending on your logging system, the following files will be loaded:
800830|Log4j
801831|`log4j.properties` or `log4j.xml`
802832
833+ |Log4j2
834+ |`log4j2.xml`
835+
803836|JDK (Java Util Logging)
804837|`logging.properties`
805838|===
0 commit comments