So, I was adding come code for a logger to my stuff and my editor
offered me a selection of loggers. Since this is my first time with
1.5 I was surprised to see that there was a built in logging mechanism
in Java5.
So, then it brought me to the question of which is better? I noticed
that log4j has many more logger output destinations than the sun one.
Which means out-of-the-box usage is fast. But, since it's part of the
JDK, SUNs logger has no dependencies
Sun was so late with a logging platform I fear they may have lost out
to log4j.
Any thoughts?
Christian Bongiorno
http://christian.bongiorno.org
Arne Vajhøj - 06 Oct 2007 02:26 GMT
> So, I was adding come code for a logger to my stuff and my editor
> offered me a selection of loggers. Since this is my first time with
[quoted text clipped - 10 lines]
>
> Any thoughts?
I would use java.util.logging for a JSE desktop app. No need for
an extra jar and the logging requirements are probably not
that sophisticated.
I would use log4j for a JEE server app. The chances are >95% that
log4j will already be there. And performance and support for
weird logging destinations can be critical.
Arne
Mark Thornton - 07 Oct 2007 16:33 GMT
> Sun was so late with a logging platform I fear they may have lost out
> to log4j.
No I think there are significant bodies of code using both platforms.
And of course there are then logging wrapper libraries that try to hide
both of them. So instead of having just one logging platform we have at
least three. Unfortunately neither log4j or java logging is a subset of
the other.
Zsolt Koppany - 08 Oct 2007 07:33 GMT
We tried to move from log4j to sun's logging package (just to have one
package less) but figured out that log4j is much better.
Zsolt
>> Sun was so late with a logging platform I fear they may have lost out
>> to log4j.
[quoted text clipped - 4 lines]
> three. Unfortunately neither log4j or java logging is a subset of the
> other.
Karl Uppiano - 08 Oct 2007 08:20 GMT
> We tried to move from log4j to sun's logging package (just to have one
> package less) but figured out that log4j is much better.
It seems to be a bit of a religious issue around my workplace. Fortunately,
it is relatively easy to switch between one and the other, the API is
similar. I tend to prefer the self-contained aspect of using JUL
(java.util.logging) as opposed to having to drag in a third party jar just
to do logging.