"Java" is a little bit of a small harvest of Java logs

Source: Internet
Author: User

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.

  1. Slf4j-api
  2. Binding: Tell slf4j what to use as the underlying framework
  3. 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.