Include the application name on each log line when it is available

Update Logback and Log4J2 so that they include the application name on
each log line. If `spring.application.name` had not been set, or if
`logging.include-application-name` is `false` then the name is not
logged.

Closes gh-35593
This commit is contained in:
Phillip Webb
2023-06-21 21:56:20 -07:00
parent c1b295fd71
commit 493777d3c9
15 changed files with 95 additions and 10 deletions

View File

@@ -31,6 +31,7 @@ The following items are output:
* Log Level: `ERROR`, `WARN`, `INFO`, `DEBUG`, or `TRACE`.
* Process ID.
* A `---` separator to distinguish the start of actual log messages.
* Application name: Enclosed in square brackets (logged by default only if configprop:spring.application.name[] is set)
* Thread name: Enclosed in square brackets (may be truncated for console output).
* Correlation ID: If tracing is enabled (not shown in the sample above)
* Logger name: This is usually the source class name (often abbreviated).
@@ -39,6 +40,7 @@ The following items are output:
NOTE: Logback does not have a `FATAL` level.
It is mapped to `ERROR`.
TIP: If you have a configprop:spring.application.name[] property but don't want it logged you can set configprop:logging.include-application-name[] to `false`.
[[features.logging.console-output]]