mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Unify console and file logback patterns
Update the file log pattern to write the thread name after the `---` separator. The allows both file and console logs to be parsed in the same way. Fixes gh-2136
This commit is contained in:
parent
df1dede57f
commit
6b4bb4d654
@ -734,6 +734,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.
|
||||
* Thread name -- Enclosed in square brackets (may be truncated for console output).
|
||||
* Logger name -- This is usually the source class name (often abbreviated).
|
||||
* The log message.
|
||||
|
||||
|
@ -46,7 +46,7 @@ class DefaultLogbackConfiguration {
|
||||
+ "%clr(:){faint} %m%n%wex";
|
||||
|
||||
private static final String FILE_LOG_PATTERN = "%d{yyyy-MM-dd HH:mm:ss.SSS} %5p "
|
||||
+ "${PID:- } [%t] --- %-40.40logger{39} : %m%n%wex";
|
||||
+ "${PID:- } --- [%t] %-40.40logger{39} : %m%n%wex";
|
||||
|
||||
private static final Charset UTF8 = Charset.forName("UTF-8");
|
||||
|
||||
|
@ -10,7 +10,7 @@ initialization performed by Boot
|
||||
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
|
||||
|
||||
<property name="CONSOLE_LOG_PATTERN" value="%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t{14}]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex"/>
|
||||
<property name="FILE_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${PID:- } [%t] --- %-40.40logger{39} : %m%n%wex"/>
|
||||
<property name="FILE_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${PID:- } --- [%t] %-40.40logger{39} : %m%n%wex"/>
|
||||
|
||||
<appender name="DEBUG_LEVEL_REMAPPER" class="org.springframework.boot.logging.logback.LevelRemappingAppender">
|
||||
<destinationLogger>org.springframework.boot</destinationLogger>
|
||||
|
Loading…
Reference in New Issue
Block a user