Differences between NLOG4J and log4j

NLOG4J is a production-quality log4j-replacement with direct SLF4J API support. NLOG4J is maintained by Ceki Gülcü, the founder of the log4j project. In a nutshell, NLOG4J can be considered as a drop-in replacement for log4j version 1.2.9.

Voluntary omission of LF5, chainsaw and NTEventAppender

In order to save space, it was decided not to bundle LF5, chainsaw and NTEventAppender with NLOG4J.

Changes in NLOG4J 1.2.25

NLOG4J 1.2.25 is identical to NLOG4J 1.2.24 except that the previous version was mistakenly compiled with JDK 1.5 instead of JDK 1.4. Thus, NLOG4J 1.2.25 should be compatible with JDK 1.4.

Changes in NLOG4J 1.2.24

NLOG4J 1.2.24 is identical to NLOG4J 1.2.23 except modifications to its Maven POM file. This changes was requested by Apache Directory Server project in order to avoid pulling in jar files licensed by Sun Inc.

Changes in NLOG4J 1.2.23

NLOG4J 1.2.23 is identical to NLOG4J 1.2.22 except that it contains the classes of the latest SLF4J release, that is version 1.0. For all practical purposes, it should be indistinguishable from version 1.2.22.

Changes in NLOG4J 1.2.22

NLOG4J 1.2.22 mirrors the merge of the MarkingLoggerof interface into the org.slf4j.Logger interface in SLF4J 1.0RC6.

Changes in NLOG4J 1.2.21

Maintenance release improving resilience to null input.

Changes in NLOG4J 1.2.20

NLOG4J 1.2.20 mirrors the addition of new printing methods in the org.slf4j.Logger introduced in SLF4J 1.0RC4.

Changes in NLOG4J 1.2.19

Maintenance release fixing bug #8 and synchronization with changes in the latest SLF4J branch (version 1.0RC3).

Changes in NLOG4J 1.2.18

Minor changes reflecting the addition of the slf4j-log4j.jar binding introduced in SLF4J 1.0beta8.

Changes in NLOG4J 1.2.17

NLOG4J 1.2.17 mirrors the SLF4J binding simplifications introduced in SLF4J 1.0beta7.

Changes in NLOG4J 1.2.16

In NLOG4J 1.2.16, contrary to versions 1.2.14 and 1.2.15, the Category class accepts parameters of type Object as well as String.

This change was introduced to overcome compatibility problems between log4j and NLOG4J. In particular, previous to NLOG4J 1.2.16, software compiled with log4j would not run with NLOG4J.

Changes in NLOG4J 1.2.15

NLOG4J 1.2.15 added nominal suppport for the Marker interface which was added to SLF4J in 1.0beta5.

Changes in NLOG4J 1.2.14

String instead of Object

The org.slf4j.Logger interface restricts the type of messages that can be logged to java.lang.String instead of java.lang.Object.

Thus, while in log4j you can write

logger.debug(new Interger(10));

in NLOG4J the previous line will not compile and needs to be re-rewitten as:

logger.debug((new Interger(10)).toString());

or alternatively, as:

logger.debug("{}", new Interger(10)); // recommended and more efficient form

We recommend the second form because it avoids the toString() invocation on the Interger object in case the log statement is disabled for the DEBUG level. See the Question 2.3 in SLF4J FAQ for more details.

Nick Faiz from the Apache Directory project reported compatibility issues with NLOG4J when used in conjunction with Jakarta Commons Logging.

As mentioned above, while printing methods in log4j take an argument of type java.lang.Object, the org.slf4j.Logger interface imposes that this parameter be of type java.lang.String. NLOG4J loggers which directly implement the org.slf4j.Logger interface relay this restriction.

Luckily, JCL uses a special printing method which lies beyond those found in the org.slf4j.Logger interface. NLOG4J release 1.2.14 modifies this special printing method so as to retain compatibility with JCL while still adhering to the org.slf4j.Logger interface.

Changes in NLOG4J 1.2.13

Following discussions on the SLF4J developers list, the signatures of the printing methods in org.slf4j.Logger interface have been modified to admit messages of type String instead of type Object as previously.

NLOG4J release 1.2.13 reflects changes in the SLF4J API.

Changes in NLOG4J 1.2.12

Release 1.2.12 reflects changes in the SLF4J API, in particular renaming of org.slf4j.ULogger interface as org.slf4j.Logger.

Changes NLOG4J 1.2.11

NLOG4J project is based on log4j 1.2.9. It is differs from log4j 1.2.9 in its native support for the SLF4J API. Due to space considerations, NLOG4J does not bundle LF5, chainsaw nor NTEventLogAppender.

NLOG4J should be considered as a production quality drop-in replacement for log4j version 1.2.9. NLOG4J is maintained by Ceki Gülcü, the founder of the log4j project.