Technical architectural analysis, practical configuration manifests, and deployment instructions for Spring Boot Actuator Logback Logger Conflict.
Looking at this setting, changing the log level through Actuator is likely not possible in some packages.
I will analyze the cause and suggest a solution. ๐
๐ Problem Analysis
โ
1๏ธโฃ root log level fixed to WARN
xml
๋ณต์ฌํธ์ง
<root level="warn">
rootlog level is set toWARN.- Even if you change the root log level in Actuator, there is a possibility that only
WARNor higher will be output. - Because
rootisWARN, it may not be applied even if certain packages are set to DEBUG.
๐น How to check
- Check current root log level with endpoint
/actuator/loggers/root
sh
๋ณต์ฌํธ์ง
curl -X GET http://localhost:8080/actuator/loggers/root
- Example response
json
๋ณต์ฌํธ์ง
{
"configuredLevel": "WARN",
"effectiveLevel": "WARN"
}
- If
effectiveLevelis maintained even ifconfiguredLevelis changed, root settings have been applied first.
โ
2๏ธโฃ Certain packages (e.g. iaas, org.springframework) force level in logback
xml
๋ณต์ฌํธ์ง
<logger name="iaas" level="debug" additivity="false">
xml
๋ณต์ฌํธ์ง
<logger name="org.springframework" level="debug" additivity="false">
- If the log level of a specific package is hardcoded in logback.xml, it cannot be changed in Actuator.
- Actuator changes settings dynamically, but override is not possible if
level="debug"is specified in the logback.
๐น How to check
- Check current settings with endpoint
/actuator/loggers/iaas
sh
๋ณต์ฌํธ์ง
curl -X GET http://localhost:8080/actuator/loggers/iaas
- Example response
json
๋ณต์ฌํธ์ง
{
"configuredLevel": "null",
"effectiveLevel": "DEBUG"
}
- If
configuredLevelisnull, it cannot be changed in the Actuator. - The actuator change is not applied because it is forcibly set to
level="debug".
๐ Solution (Make log level changeable in Actuator)
โ
1๏ธโฃ root Lower log level and adjust specific packages to be able to be changed to Actuators
Currently, root is set to WARN, so there is a possibility that changes will not be reflected in Actuator.
xml
๋ณต์ฌํธ์ง
<root level="DEBUG">
If you change it like this, there is a higher possibility that the settings changed in Actuator will be applied.
โ
2๏ธโฃ Remove the level property of a specific package and make it changeable in the Actuator
Currently, the log level of a specific package is hard-coded as shown below, so it cannot be changed in Actuator.
xml
๋ณต์ฌํธ์ง
<logger name="iaas" level="debug" additivity="false">
xml
๋ณต์ฌํธ์ง
<logger name="org.springframework" level="debug" additivity="false">
โก If you change it like this, you can change it dynamically in the actuator.
xml
๋ณต์ฌํธ์ง
<logger name="iaas" additivity="false">
<appender-ref ref="consoleAppender"/>
<appender-ref ref="dailyRollingFileAppender"/>
<appender-ref ref="overwriteFileAppender"/>
</logger>
<logger name="org.springframework" additivity="false">
<appender-ref ref="consoleAppender"/>
<appender-ref ref="dailyRollingFileAppender"/>
<appender-ref ref="overwriteFileAppender"/>
</logger>
๐ If you modify it like this, you can dynamically change the log level in the actuator.
โ
3๏ธโฃ Activate Actuator log change function (checkwrite: true)
In application.yml, you must check whether the loggers endpoint of the Actuator is write enabled.
yaml
๋ณต์ฌํธ์ง
management:
endpoints:
web:
exposure:
include: loggers
endpoint:
loggers:
enabled: true
write: true # โ
๋ก๊ทธ ๋ ๋ฒจ ๋ณ๊ฒฝ ๊ฐ๋ฅํ๋๋ก ์ค์
- If there is no
write: truesetting, the log level cannot be changed in the actuator. - Need to check whether the settings are applied in the operating environment.
๐ Final Summary (Things that need to be fixed)
โ Lower the log level of root to enable log changes
โ Remove the level="debug" setting of a specific package from logback-spring.xml and make it changeable in Actuator
โ Check the Actuator’s write: true setting in application.yml
If you modify it like this, you will be able to change the log in Actuator! ๐
If there is something that doesn’t work after testing, you can check it further. ๐ช




Leave a Reply