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 <[EMAIL PROTECTED]> 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

Reply via email to