You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Werner Punz <we...@gmail.com> on 2012/09/03 16:31:11 UTC

Re: Redirecting JUL Logging to other logging systems -- do we need to revisit our logging methodology?

Just a minor sidequestion, why do you use the SLF4JBridgeHandler JUL 
layer instead of JUL directly?

Werner


Am 23.08.12 16:40, schrieb Mike Kienenberger:
> Did you ever say something you really regretted?
>
> I really regret saying that I strongly preferred JUL over SL4J on the
> logging vote two years back[1].
>
> [1] http://mail-archives.apache.org/mod_mbox/myfaces-dev/200906.mbox/%3C8f985b960906060447g30bb216ew62102b39be2a1f27@mail.gmail.com%3E
>
> I am currently using the SLF4JBridgeHandler for JUL during
> development, and incurring the performance hits.
>
> Barring other events, my plans are to default back to JUL logging for
> production.
>
> How are other people handling this?  I know at the time of the
> discussion many people were switching to SL4J or still using log4j or
> JCL, all of which would have the same performance issues.
>
> Is it time to revisit our logging yet again, now that we know the
> theoretical flexibility of JUL didn't live up to the practical reality
> of using it?
>
> slf4j and myfaces
> http://mail-archives.apache.org/mod_mbox/myfaces-dev/200906.mbox/%3C2332f63b0906050818q6c74e615u2edc7cc2ec9f5101@mail.gmail.com%3E
>
> [VOTE] jul instead of commons-logging
> http://mail-archives.apache.org/mod_mbox/myfaces-dev/200906.mbox/%3C2332f63b0906091132y10cd0dadu4eb4a36dda6ae683@mail.gmail.com%3E
>
> [VOTE] use of jul or commons logging on myfaces core 2.0
> http://mail-archives.apache.org/mod_mbox/myfaces-dev/200910.mbox/%3Cf6c92360909301905g104297a5m3bba5fb3d0574fd@mail.gmail.com%3E
>
> https://issues.apache.org/jira/browse/MYFACES-2378
>



Re: Redirecting JUL Logging to other logging systems -- do we need to revisit our logging methodology?

Posted by Mike Kienenberger <mk...@gmail.com>.
1) Because I already have logging configured using log4j, and I have
dependencies on JCL and log4j and slf4j from other libraries.

2) Because there is no easy way to configure logging from the classpath.

3) Because the default output of JUL is two lines instead of one.
Also, some other issues:

- JUL only has SEVERE, a combining of FATAL and ERROR.
- SL4J has parametrized logging
- SLF4J's message formatter is 10 times faster than
java.util.Formatter. It actually makes a measurable difference at the
end. – Ceki Jun 4 '09 at 16:16

I could solve 1) by changing my SLF4J configuration

I have solved 2) before -- A google search turns up my class and
configuration to fix that problem
(http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4958543).   But
that's not what I call "configuring."

I have not looked into 3) yet.   I'm sure there's a way to do it, but
it looks like yet another class to maintain.
http://stackoverflow.com/questions/194765/how-do-i-get-java-logging-output-to-appear-on-a-single-line
-- so, yes, you write yet another class.   I'll still trying to
determine how you install the new formatter class.


But none of this is really relevant.   The question isn't whether I
should use JUL.   The question is whether MyFaces should.

I too voted for JUL in a large part to remove the dependency.   But we
also thought back then that end-users could configure JUL to log to
other logging systems.   They can, but we now know that it forces an
unacceptable performance hit.

Furthermore, you don't configure JUL.  You subclass it.   Which means
you've traded a dependency on a well-known logging system for a
situation in which everyone is writing and maintaining their own
custom logging classes.



On Mon, Sep 3, 2012 at 10:31 AM, Werner Punz <we...@gmail.com> wrote:
> Just a minor sidequestion, why do you use the SLF4JBridgeHandler JUL layer
> instead of JUL directly?
>
> Werner
>
>
> Am 23.08.12 16:40, schrieb Mike Kienenberger:
>
>> Did you ever say something you really regretted?
>>
>> I really regret saying that I strongly preferred JUL over SL4J on the
>> logging vote two years back[1].
>>
>> [1]
>> http://mail-archives.apache.org/mod_mbox/myfaces-dev/200906.mbox/%3C8f985b960906060447g30bb216ew62102b39be2a1f27@mail.gmail.com%3E
>>
>> I am currently using the SLF4JBridgeHandler for JUL during
>> development, and incurring the performance hits.
>>
>> Barring other events, my plans are to default back to JUL logging for
>> production.
>>
>> How are other people handling this?  I know at the time of the
>> discussion many people were switching to SL4J or still using log4j or
>> JCL, all of which would have the same performance issues.
>>
>> Is it time to revisit our logging yet again, now that we know the
>> theoretical flexibility of JUL didn't live up to the practical reality
>> of using it?
>>
>> slf4j and myfaces
>>
>> http://mail-archives.apache.org/mod_mbox/myfaces-dev/200906.mbox/%3C2332f63b0906050818q6c74e615u2edc7cc2ec9f5101@mail.gmail.com%3E
>>
>> [VOTE] jul instead of commons-logging
>>
>> http://mail-archives.apache.org/mod_mbox/myfaces-dev/200906.mbox/%3C2332f63b0906091132y10cd0dadu4eb4a36dda6ae683@mail.gmail.com%3E
>>
>> [VOTE] use of jul or commons logging on myfaces core 2.0
>>
>> http://mail-archives.apache.org/mod_mbox/myfaces-dev/200910.mbox/%3Cf6c92360909301905g104297a5m3bba5fb3d0574fd@mail.gmail.com%3E
>>
>> https://issues.apache.org/jira/browse/MYFACES-2378
>>
>
>