You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Dudu <ed...@yahoo.com.br> on 2006/03/27 20:56:32 UTC

disabling logs on myfaces

I have a log4j.properties file, but I want it only to logs generated by my
application...
How can I do this... the better way... are there a way to disable the logs
of myfaces, in the web.xml???

Thanks

Re: disabling logs on myfaces

Posted by Eduardo Dudu Ivan Pichler <ed...@yahoo.com.br>.
Thanks. I solve my problema, there was an little error on log4j.xml
[]'s

On 3/30/06, Mert Çalışkan <mc...@gmail.com> wrote:
>
> xml file can be anywhere in your classpath.
>
> But you have to choose between log4j api or sun's logging in jdk.
> log4j.jar should also be in the classpath with commons-logging.jar if you
> choose it. log4j.xml has usage precedence over the properties file.
>
> you can also give a VM argument for the location of your log4j.xml like,
> -Dlog4j.configuration=file:///C:/log4j.xml
>
> Cheers,
>
>
> -Mert
> http://www.jroller.com/page/mert
>
>
> On 3/30/06, Eduardo Dudu Ivan Pichler <ed...@yahoo.com.br> wrote:
> >
> > this is exactly what I need Mert, but I put this file on my
> > /web-inf/classes/ but the web application is not founding the file
> > log4j.xml.
> > Are there a parameter to be setted?
> > thanks again
> >
> > On 3/28/06, Mert Çalışkan <mcaliskan@gmail.com > wrote:
> > >
> > >  You can define a log4j.xml in your classpath i definitely suggest you
> > > to use commons-logging. Here is an example log4j.xml. You can define
> > > multiple loggers with different package names. By this you can discriminate
> > > your application ( tr.yourpackagename) log. You can also add other
> > > appenders.
> > >
> > >
> > > <?xml version="1.0" encoding="UTF-8" ?>
> > > <!DOCTYPE log4j:configuration PUBLIC "-//LOG4J" "log4j.dtd">
> > > <log4j:configuration xmlns:log4j=" http://jakarta.apache.org/log4j/">
> > >
> > >     <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
> > >         <layout class="org.apache.log4j.PatternLayout">
> > >             <param name="ConversionPattern" value="%d{dd MMM yyyy
> > > HH:mm:ss,SSS} - %p - %C{1}.%M(%L) | %m%n"/>
> > >         </layout>
> > >     </appender>
> > >
> > >     <logger name="org.hibernate">
> > >         <level value="ERROR"/>
> > >     </logger>
> > >
> > >     <logger name="org.springframework">
> > >         <level value="DEBUG"/>
> > >     </logger>
> > >
> > >     <logger name="tr.yourpackagename">
> > >         <level value="DEBUG"/>
> > >     </logger>
> > >
> > >     <root>
> > >         <level value="DEBUG"/>
> > >         <appender-ref ref="CONSOLE"/>
> > >     </root>
> > >
> > > </log4j:configuration>
> > >
> > >
> > > On 3/27/06, Dudu <eduardoniceman@yahoo.com.br > wrote:
> > > >
> > > > I have a log4j.properties file, but I want it only to logs generated
> > > > by my application...
> > > > How can I do this... the better way... are there a way to disable
> > > > the logs of myfaces, in the web.xml ???
> > > >
> > > > Thanks
> > > >
> > >
> > >
> > >
> >
> >
> >
> > --
> > ----------
> > Dudu
> > GoogleTalk: eduardopichler[at]gmail[dot]com
> > skype:eduardopichler
> >
>
>


--
----------
Dudu
GoogleTalk: eduardopichler[at]gmail[dot]com
skype:eduardopichler

Re: disabling logs on myfaces

Posted by Mert Çalışkan <mc...@gmail.com>.
xml file can be anywhere in your classpath.

But you have to choose between log4j api or sun's logging in jdk.
log4j.jar should also be in the classpath with commons-logging.jar if you
choose it. log4j.xml has usage precedence over the properties file.

you can also give a VM argument for the location of your log4j.xml like,
-Dlog4j.configuration=file:///C:/log4j.xml

Cheers,


-Mert
http://www.jroller.com/page/mert


On 3/30/06, Eduardo Dudu Ivan Pichler <ed...@yahoo.com.br> wrote:
>
> this is exactly what I need Mert, but I put this file on my
> /web-inf/classes/ but the web application is not founding the file
> log4j.xml.
> Are there a parameter to be setted?
> thanks again
>
> On 3/28/06, Mert Çalışkan <mc...@gmail.com> wrote:
> >
> >  You can define a log4j.xml in your classpath i definitely suggest you
> > to use commons-logging. Here is an example log4j.xml. You can define
> > multiple loggers with different package names. By this you can discriminate
> > your application ( tr.yourpackagename) log. You can also add other
> > appenders.
> >
> >
> > <?xml version="1.0" encoding="UTF-8" ?>
> > <!DOCTYPE log4j:configuration PUBLIC "-//LOG4J" "log4j.dtd">
> > <log4j:configuration xmlns:log4j=" http://jakarta.apache.org/log4j/">
> >
> >     <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
> >         <layout class="org.apache.log4j.PatternLayout">
> >             <param name="ConversionPattern" value="%d{dd MMM yyyy
> > HH:mm:ss,SSS} - %p - %C{1}.%M(%L) | %m%n"/>
> >         </layout>
> >     </appender>
> >
> >     <logger name="org.hibernate">
> >         <level value="ERROR"/>
> >     </logger>
> >
> >     <logger name="org.springframework">
> >         <level value="DEBUG"/>
> >     </logger>
> >
> >     <logger name="tr.yourpackagename">
> >         <level value="DEBUG"/>
> >     </logger>
> >
> >     <root>
> >         <level value="DEBUG"/>
> >         <appender-ref ref="CONSOLE"/>
> >     </root>
> >
> > </log4j:configuration>
> >
> >
> > On 3/27/06, Dudu <eduardoniceman@yahoo.com.br > wrote:
> > >
> > > I have a log4j.properties file, but I want it only to logs generated
> > > by my application...
> > > How can I do this... the better way... are there a way to disable the
> > > logs of myfaces, in the web.xml ???
> > >
> > > Thanks
> > >
> >
> >
> >
>
>
>
> --
> ----------
> Dudu
> GoogleTalk: eduardopichler[at]gmail[dot]com
> skype:eduardopichler
>

Re: disabling logs on myfaces

Posted by Mert Çalışkan <mc...@gmail.com>.
You can define a log4j.xml in your classpath i definitely suggest you to use
commons-logging. Here is an example log4j.xml. You can define multiple
loggers with different package names. By this you can discriminate your
application (tr.yourpackagename) log. You can also add other appenders.


<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration PUBLIC "-//LOG4J" "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

    <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{dd MMM yyyy
HH:mm:ss,SSS} - %p - %C{1}.%M(%L) | %m%n"/>
        </layout>
    </appender>

    <logger name="org.hibernate">
        <level value="ERROR"/>
    </logger>

    <logger name="org.springframework">
        <level value="DEBUG"/>
    </logger>

    <logger name="tr.yourpackagename">
        <level value="DEBUG"/>
    </logger>

    <root>
        <level value="DEBUG"/>
        <appender-ref ref="CONSOLE"/>
    </root>

</log4j:configuration>


On 3/27/06, Dudu <ed...@yahoo.com.br> wrote:
>
> I have a log4j.properties file, but I want it only to logs generated by my
> application...
> How can I do this... the better way... are there a way to disable the logs
> of myfaces, in the web.xml???
>
> Thanks
>

RE: disabling logs on myfaces

Posted by Brian Woolf <ys...@163.com>.
this is my log4j.properties,example to help you.

# Options are: DEBUG, INFO, WARN, ERROR, FATAL
log4j.category.youapp=DEBUG
log4j.category.org.springframework=ERROR
log4j.category.javax.faces=ERROR
log4j.category.org.hibernate=ERROR
log4j.category.org.apache.struts=ERROR


--
View this message in context: http://www.nabble.com/disabling-logs-on-myfaces-t1351076.html#a3671092
Sent from the MyFaces - Users forum at Nabble.com.


RE: disabling logs on myfaces

Posted by Lance Frohman <lf...@gmail.com>.
What is in your log4j.properties? You have some setting in it to show the
myfaces logs.

  _____  

From: eduardopichler@gmail.com [mailto:eduardopichler@gmail.com] On Behalf
Of Dudu
Sent: Monday, March 27, 2006 10:57 AM
To: MyFaces Official List
Subject: disabling logs on myfaces


I have a log4j.properties file, but I want it only to logs generated by my
application...
How can I do this... the better way... are there a way to disable the logs
of myfaces, in the web.xml???

Thanks