Re: What's wrong with Log4J

From: Holger Hoffstätte (holge..izards.de)
Date: Sat May 14 2005 - 09:17:00 EDT

  • Next message: Mike Kienenberger: "Re: What's wrong with Log4J"

    Todd O'Bryan wrote:
    > There's a lot of discussion about getting away from Log4J. Why?
    >
    > I think I may have missed something, and since I've been using it to
    > log my own stuff...

    There is absolutely nothing wrong with log4j, the only thing that's
    "wrong" is Sun and their attitude to include their own (in many ways
    inferior) java.util.logging APIs which are part of the JRE. Now in order
    to be able to have consistent logging output in a mixed environment
    classes need a single unified way to do the actual logging, which was the
    reason for commons-logging. Unfortunately - for obvious reasons -
    commons-logging can only be a least-common-denominator and so does not
    include any way to use logging levels via code, (since they differ across
    log4j & util.logging) - but unfortunately that's exactly what Cayenne
    needs. Effectively we could

    a) try to remove commons-logging: basically impossible because so many
    other third-party packages depend on it

    b) convert everything to util.logging: Andrus is still targeting 1.3
    compatibility, and also people would complain why Cayenne does not use
    log4j (rightly so)

    c) make Cayenne use commons-logging whenever possible and write a
    super-micro-thin abstraction to allow the two or three classes that
    require logging access to the "backend"; that's what I sort-of started
    yesterday

    IOW, whatever we do someones is going to complain, for good reason. People
    commonly think that logging, configuration etc. are "very simple, just
    load the config file and...". Nothing could be further from the truth; in
    fact these bootstrapping services are _incredibly_ hard to get right for a
    variety of application and more importantly failure scenarios (graceful
    degradation and all that). The entire logging travesty would not exist if
    Sun had just used log4j instead of rolling their own (borrowed from IBM, I
    believe), even if they had moved it into the util.logging namespace.

    -h



    This archive was generated by hypermail 2.0.0 : Sat May 14 2005 - 09:17:02 EDT