Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which log4j facade to choose?

Essentially I'm looking for something with the same behavior, configuration, logging levels as log4j, but with some of the missing functionality (e.g. formatted logging — see here and here for related SO threads.)

Current nominees are slf4j and log5j.

like image 395
ripper234 Avatar asked Dec 02 '22 08:12

ripper234


2 Answers

I'm inclined toward SLF4J.

  • allows parameterized logging (formatting)
  • allows consolidation of other frameworks (great for apps using many libraries, each logging to a different framework)

log5j is good, but does not have near as much market penetration.

like image 162
Chadwick Avatar answered Dec 31 '22 05:12

Chadwick


since a lot of frameworks already support slf4j you will only have to setup your logging once with slf4j.

i use slf4j and it is super-easy to read + use.

like image 38
Andreas Petersson Avatar answered Dec 31 '22 05:12

Andreas Petersson