Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Java has the java.util.logging classes.


Java historically has had so many logging frameworks it needs logging framework adapters to deal with the problem that in any significant program you will end up with dependencies that log in incompatible ways :/

It probably has the most complex and messy logging story of any language - but at least the solutions are very mature at this point.


Not a good example, as the de-facto logging interface for Java was SLF4J.

Though I myself prefer Log4J2, as I'm already using Log4J2 as the concrete logging implementation.


Why do you prefer Log4j2 over the slf4j api and why over logback as the backend?


I prefer Log4J2 built-in JSON Template Layout to Logback's various JSON output solution.

The API of Log4J2 and SLF4J v2 are similar enough that it does not matter for basic usage, I don't see the benefit of SLF4J in a project that's already using Log4J2.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: