Let me just say up front that I’m not making an argument to change the logging in odejava. I can’t argue with log4j’s extra features, though I’ve never used them.
But…, grabbing the log4j.jar file is just the beginning.
I prefer not to install libraries using Java’s extension mechanism for the simple reason that it’s too easy to forget they’re not a standard part of the Java dist. I have my own lib directory I install this stuff into and that forces me to deal with the libs in my build.xml and startup scripts. That, in turn, better documents my app’s dependencies. I’ve been bitten too many times to count by “publishing” an application only to have a user install it and not be able to run it because they don’t have some component I’ve been taking for granted. Not only in Java, but Perl, C, etc. I prefer to force myself not to take third party libs for granted.
And even if I wasn’t crazy as described in the previous paragraph, I’d have to remember to sign the log4j.jar and include it in the webstart config for my app since the average user will not have downloaded and installed, let alone even heard about, the extra library. Using my technique above doesn’t change this, except that my ant build script now explicitly specifies the dependencies, and won’t even compile my project without them, so I have a place to go to find them.
Of course, I also use Java3D, which is installed in Java’s ext dir by default, which annoys me. That’s another can of worms I won’t get into now.
And of course all of this is getting dangerously close to the personal philosophies most programmers develop over time and like to defend to their deaths. I’m not trying to convince anyone my way’s better. Take it or leave it.
-Tab