Skip to content

Commit 6941d0e

Browse files
committed
Document that logging.file.path if logging.file.name is set
Closes gh-41351
1 parent 49538ad commit 6941d0e

File tree

1 file changed

+13
-10
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/asciidoc/features

1 file changed

+13
-10
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/logging.adoc

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,30 +125,33 @@ The following colors and styles are supported:
125125
=== File Output
126126
By default, Spring Boot logs only to the console and does not write log files.
127127
If you want to write log files in addition to the console output, you need to set a configprop:logging.file.name[] or configprop:logging.file.path[] property (for example, in your `application.properties`).
128+
If both properties are set, `logging.file.path` is ignored and only `logging.file.name` is used.
128129

129130
The following table shows how the `logging.*` properties can be used together:
130131

131132
.Logging properties
132-
[cols="1,1,1,4"]
133+
[cols="1,1,4"]
133134
|===
134-
| configprop:logging.file.name[] | configprop:logging.file.path[] | Example | Description
135+
| configprop:logging.file.name[] | configprop:logging.file.path[] | Description
135136

136137
| _(none)_
137138
| _(none)_
138-
|
139139
| Console only logging.
140140

141-
| Specific file
141+
| Specific file (for example, `my.log`)
142142
| _(none)_
143-
| `my.log`
144-
| Writes to the specified log file.
145-
Names can be an exact location or relative to the current directory.
143+
| Writes to the location specified by `logging.file.name`.
144+
The location can be absolute or relative to the current directory.
146145

147146
| _(none)_
147+
| Specific directory (for example, `/var/log`)
148+
| Writes `spring.log` to the directory specified by `logging.file.path`.
149+
The directory can be absolute or relative to the current directory.
150+
151+
| Specific file
148152
| Specific directory
149-
| `/var/log`
150-
| Writes `spring.log` to the specified directory.
151-
Names can be an exact location or relative to the current directory.
153+
| Writes to the location specified by `logging.file.name` and ignores `logging.file.path`.
154+
The location can be absolute or relative to the current directory.
152155
|===
153156

154157
Log files rotate when they reach 10 MB and, as with console output, `ERROR`-level, `WARN`-level, and `INFO`-level messages are logged by default.

0 commit comments

Comments
 (0)