Just google https://www.baeldung.com/spring-boot-changing-log-level-at-runtime . Hope it can help you

Norbert Kiesel <nkiesel@metricstream.com> 于2020年12月9日周三 下午1:28写道:
Hi,

I want to dynamically add (and eventually remove again) loggers to a system.  The idea is that based on specific events (e.g. a flag in a HTTP REST request header), the logs for this request are written to a separate file (in addition to writing to the usual log file).  I also want to modify the log-level for this request to TRACE - ideally just for the messages written to the dedicated log file.  Is configuring a SiftingAppender the correct approach for that? And does anyone have some sample code they could share?  Any help/feedback is greatly appreciated!


</nk>

---


Norbert Kiesel
Systems Architect, Engineering
E: nkiesel@metricstream.com
W: www.metricstream.com


_______________________________________________
logback-user mailing list
logback-user@qos.ch
http://mailman.qos.ch/mailman/listinfo/logback-user