Files
spring-boot-demo/log4j2-levels/output/10-property-overrides.txt
T

33 lines
1.5 KiB
Plaintext

# log4j2-spring.xml says: com.ankurm.log4j2levels.service = DEBUG, root = INFO
# 1. --logging.level.com.ankurm.log4j2levels.service=WARN on the command line
{"configuredLevel":"WARN","effectiveLevel":"WARN"} [HTTP 200]
# 2. the same override as an environment variable
{"configuredLevel":"TRACE","effectiveLevel":"TRACE"} [HTTP 200]
# 3. --logging.level.root=ERROR, which the XML's root level should be competing with
{"effectiveLevel":"ERROR"} [HTTP 200]
# 4. a custom level through the property: --logging.level.com.ankurm.log4j2levels.service=DIAG
app did not start; first lines of its output:
ERROR o.s.b.d.LoggingFailureAnalysisReporter -
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under 'logging.level.com.ankurm.log4j2levels.service' to org.springframework.boot.logging.LogLevel:
Property: logging.level.com.ankurm.log4j2levels.service
Value: "DIAG"
Origin: "logging.level.com.ankurm.log4j2levels.service" from property source "commandLineArgs"
Reason: failed to convert java.lang.String to org.springframework.boot.logging.LogLevel (caused by java.lang.IllegalArgumentException: No enum constant org.springframework.boot.logging.LogLevel.DIAG)
Action:
Update your application's configuration. The following values are valid:
DEBUG
ERROR
FATAL
INFO
# 5. a custom level in a separate logger written as log4j2 itself reads it (see diag in the XML)
{"configuredLevel":"DIAG","effectiveLevel":"DIAG"} [HTTP 200]