How to globally enable debug
for all the slf4j.Logger
objects?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
exists various capability to switch debug log on:
this article have good explanation all of those. to me good fit is:
Using slf4j with Log4j logger
create file src/main/resources/log4j.properties
Use logback as the slf4j binding.
The default behaviour without an configuration file is to log all events at level DEBUG and above to System.out. See http://logback.qos.ch/manual/configuration.html#automaticConf for details.
For log4j
by this cofiguration your all "com.mypackage" logs will be written in "web.log" file under catalina.home.
depends on what binding you are using... if e.g. it's log4j have a look at http://logging.apache.org/log4j/1.2/manual.html and its Configuration chapter
If you use log4j as the binding of slf4j you can crete a log4j.xml (or log4j.properties) file and add it to the classpath. An example could be:
Programmatically, with logback:
where