users@glassfish.java.net

Re: Commons Logging and Log4J

From: Kristian Rink <kawazu_at_zimmer428.net>
Date: Fri, 22 Aug 2008 13:30:34 +0200

Hi Henning;

glassfish_at_javadesktop.org schrieb:
[...]
> thank you for the information and the link.
> Un-deploying and then re-deploying unfortunately still does not do the
> trick...

What kind of applications overally are involved here, asides roller (if I
remember that well)? Did you, adding to this, try using log4j with an
appender different to STDOUT? Not sure whether it could be an appender
related problem...


> I'll start playing with SLF4J in a little sample project - trying to get
> around the politics... :-)

Well I surely didn't tell you to question internal software politics in your
company. ;)

Seriously: If you were to go for log4j exclusively, this would possibly make
sense. However trying to (politically) go for log4j and _still_ potentially
rework old code to use an abstraction layer on top of this doesn't make that
much sense. The whole technical discussion aside, I wonder what the
reasoning for this decision is like? Maybe you should add that ...

(a) ... the guy who started log4j (Ceki Gülcü) is now a contributor of slf4j
as well, and

(b) asides being capable of using different logging implementations, slf4j
also can "bridge" output from applications built against other logging
frameworks.

While (a) is mainly buzzword/name marketing, (b) itself is _rather_ cool: If
you have "legacy" applications depending upon, say, log4j or commons-logging
 in which you can't / don't want to change code to switch to a different
logging altogether (we in example use Spring which uses commons-logging
...), you can throw in a "bridge" implementation, like "log4j-over-slf4j",
which allows an "old" log4j based application to dump its logging to slf4j
(and, from there, to the actual logger you do have configured for your
application) _without changing code_. Have a look at

http://www.slf4j.org/legacy.html ,

this is one of the main features (asides it solving certain commons-logging
issues) that made me quickly embrace slf4j after giving it a short test. ;)

Cheers,
Kristian

-- 
Kristian Rink
cell    :  +49 176 2447 2771
business: http://www.planconnect.de
personal: http://pictorial.zimmer428.net
"we command the system. calling all recievers.
we are noisy people for a better living".
(covenant - "monochrome")