Well, this is my first written Java-related blog.
The log of the recent project in all sorts of chaos, unbearable to study a wave, or there are some gains.
We use SLF4J as the facade to implement the runtime configuration log framework.
The first is the dependent configuration.
- Slf4j-api
- Binding: Tell slf4j what to use as the underlying framework
- Implementation
If you want to use LOG4J2, then first find the binding dependency of log4j2
Then add Log4j-core according to dependency tree on Log4j2 's official website.
Specifically, I'm looking at my Gitlab project.
I'm the only one who can watch.
Too lazy to write
Another way is to use SLF4J-LOG4J12 when binding, the front with Log4j-1.2-api, class loaded with 1.2-API cover off the binding inside the relevant things, the SLF4J-LOG4J12 into a log4j2 Binding Note that the order cannot be reversed. But it was too ugly, so it was commented out.
The binding can only have one, if there are other binding in other dependencies, to manually in the POM inside exclude
"Java" is a little bit of a small harvest of Java logs