logback - Spring Boot application log level -


i want change log level of spring boot application running.

is possible change log level @ runtime? right have logger configuration in jar itself.

changing log level while application running part of underlying logger implementation.

you did not specify logger implementation using assume using default logback provided via spring-boot-starter-logging or spring-boot-starter-web dependencies.

comment out logger related configurations application.properties e.g.

#logging.path=logs #logging.level.org.springframework.web= info #logging.level.=info 

add logback.xml in root of classpath tag see http://logback.qos.ch/manual/jmxconfig.html

start application , open jconsole , go mbeans tab. select package ch.qos.logback.classic.jmxconfigurator.under default locate setloggerlevel operation e.g. org.springframework.web, debug

enter image description here

the change effective immediately. other logger libraries see spring boot user guide http://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html , library specific information e.g. log4j http://www.sureshpw.com/2012/04/dynamic-logging-with-log4j.html

a different approach repeat steps without jmx , use configuration watcher


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -