I also studied this recently. I have been using Log4J in Commons Logging for many years and have recently switched to SLF4J.
Log4j is the basis for the actual recording / distribution of the log. It is extremely flexible: you can direct it to send log messages to files, syslog, remote monitoring, etc. You can also set up multiple registrars, logging categories, include context in entries, etc. This is one of the most popular registration systems.
A built-in JDK log (which I never used to be honest) was added in JDK 1.4.2. From what I collect, it is not very popular because it is not as flexible as Log4j, but I would welcome comments :).
Both of these are facades on top of various registration frameworks that provide a common interface for your application. For example, you can use CL / SLF4J in your application, and they will automatically detect the basic login implementation (Log4J, JDK logging or a built-in logger that simply delegates to System.err.println() ). The advantage is that you or your end user can decide to run the main logical implementation by default, and they greatly simplify your implementation by eliminating many of the complexities of Log4J and JDK logs.
source share