After updating the sprinboot version I started getting the following error at the beginning of the app and the logs are not following the logging.pattern.level
from the application.properties
testApp | 2020-11-11 06:32:55,666 main ERROR Incorrect number of options on style. Expected at least 1, received 0
testApp | 2020-11-11 06:32:55,681 main WARN Class org.springframework.boot.logging.log4j2.ColorConverter does not extend PatternConverter.
testApp | 2020-11-11 06:32:55,683 main ERROR Unrecognized conversion specifier [clr] starting at position 4 in conversion pattern.
testApp | 2020-11-11 06:32:55,684 main ERROR Incorrect number of options on style. Expected at least 1, received 0
testApp | 2020-11-11 06:32:55,685 main WARN Class org.springframework.boot.logging.log4j2.ColorConverter does not extend PatternConverter.
testApp | 2020-11-11 06:32:55,685 main ERROR Unrecognized conversion specifier [clr] starting at position 14 in conversion pattern.
The pattern is as follows:
logging.pattern.level: "%clr(%5p) %clr([%X{traceId}/%X{spanId}]){yellow}"
CodePudding user response:
There has been a change in syntax in the newer versions (2.3.5 ) replace ()
with {}
as follows and see if this helps:
logging.pattern.level: "%clr{%5p} %clr{[%X{traceId}/%X{spanId}]}{yellow}"