Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any major differences between Log4J 1.2 and Log4J 2.0?

I'm curious about the differences between Log4J 1.2 and 2.0, because I've been trying to run a demo I found online ( video here ) and I've run into issues. I was especially curious about what is the role of SLF4J in all of this, i.e do you need a certain SLF4J for 1.2 vs 2.0 ?

thanks!

like image 379
Caffeinated Avatar asked Nov 12 '22 06:11

Caffeinated


1 Answers

AFAIU from the Apache Log4j 2 web site, the significant is as the following: -

  1. The performance which compare among log4j 1.x, logback and log4j 2.
  2. They provide 2 significant components as the following: -
    1. SLF4J Binding: The SLF4J bindings provided in this Bridge cause all the SLF4J APIs to be routed to Log4j 2.
    2. Log4j 2 to SLF4J Adapter: The Log4j 2 to SLF4J Adapter allows applications coded to the Log4j 2 API to be routed to SLF4J.

Then we may use either the SLF4J as a Logging Facade with log4j 2 instead of logback or use the log4j 2 natively.

I hope this information may be useful.

like image 69
Charlee Chitsuk Avatar answered Nov 30 '22 23:11

Charlee Chitsuk