You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "l.penet@senat.fr" <l....@senat.fr> on 2013/07/31 17:43:12 UTC

Logging

Dear all,

this is certainl a very simple question for most of you but...

... how do you configure myfaces logging ?

I usually use log4j for my apps.

I tried do create a commons-logging.properties file containing

org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

I also tried lines such as :

     org.apache.myfaces.renderkit.html.HtmlResponseWriterImpl.level = FINEST
org.apache.myfaces.renderkit.html.HtmlResponseWriterImpl.handlers = 
java.util.logging.ConsoleHandler

...but still do not get all logging output.

Thanks in advance,

Ludovic
(using MyFaces 2.1.12, OWB 1.1.6, CODI 1.05 on Tomcat 7.0.32)

|
| AVANT D'IMPRIMER, PENSEZ A L'ENVIRONNEMENT.
|


Re: Logging

Posted by Mike Kienenberger <mk...@gmail.com>.
We made an unfortunate decision (and I was a primary instigator of it
so I only have myself to blame) to use java.util.logging (JUL) for
Myfaces a while back.

If you want it to log via log4j, you will have to use slf4j or some
other bridge mechanism to translate the events into log4j.

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

http://blog.mycila.com/2011/01/jdk-logging-per-webapp.html (see bottom)

There is no way to use log4j instead of JUL that doesn't come with a
performance hit.   Logback is another option that could work with
slf4j that reduces the the performance hit.

There is also no trivial way to configure logging under JUL -- you
have to write code to do it.

Since you are using Tomcat, slf4j is probably the easiest solution for
you.   Other containers, like weblogic, make it much harder to get
working.


On Wed, Jul 31, 2013 at 11:43 AM, l.penet@senat.fr <l....@senat.fr> wrote:
> Dear all,
>
> this is certainl a very simple question for most of you but...
>
> ... how do you configure myfaces logging ?
>
> I usually use log4j for my apps.
>
> I tried do create a commons-logging.properties file containing
>
> org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
>
> I also tried lines such as :
>
>     org.apache.myfaces.renderkit.html.HtmlResponseWriterImpl.level = FINEST
> org.apache.myfaces.renderkit.html.HtmlResponseWriterImpl.handlers =
> java.util.logging.ConsoleHandler
>
> ...but still do not get all logging output.
>
> Thanks in advance,
>
> Ludovic
> (using MyFaces 2.1.12, OWB 1.1.6, CODI 1.05 on Tomcat 7.0.32)
>
> |
> | AVANT D'IMPRIMER, PENSEZ A L'ENVIRONNEMENT.
> |
>