I know that with config server and refresh endpoint, it is possible to dynamically change the logging level in spring boot application. To get control over the log rotation policy and json encoding for file, I decided to use logback. But this will stop me from dynamically changing the logging level.
<root level="info">
<appender-ref ref="RollingFile" />
<appender-ref ref="Console" />
</root>
This means that only info will be written to console/file. But what if I want to change it to debug/trace during runtime?
EDIT I still dont understand the root level tag. But the logback seems to be taking the log level from application.properties, which basically answers my question.
You can change loggig levle using spring-boot-acutuator endpiont.
To check loging level call this
GETmethod endpoint:http://host:port/contextpath/actuator/loggers
To check root level loggers call this
GETmethod:http://host:port/contextpath/actuator/loggers/root
To change root log level call this POST method endpoint:
http://host:port/contextpath/actuator/loggers/root
body:
By calling this endpoint u can change root log level.