To get rid of the appender warnings, you have a make an appender or logger for the specific package.
I use this kind of log4j.xml configuration (also has to be on the classpath):
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="%-25d{dd/MM/yyyy HH:mm:ss,SSS} %-5p %C{1}.%M - %m%n" />
</layout>
</appender>
<appender name="file" class="org.apache.log4j.FileAppender">
<param name="File" value="./target/projectname-test.log" />
<param name="Append" value="true" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="%-25d{dd/MM/yyyy HH:mm:ss,SSS} %-5p %C{1}.%M - %m%n" />
</layout>
</appender>
<logger name="be.foo.projectname">
<level value="debug" />
</logger>
<logger name="org.hibernate">
<level value="info" />
</logger>
<logger name="org.hibernate.SQL">
<level value="debug" />
</logger>
<logger name="org.hibernate.tool.hbm2ddl">
<level value="debug" />
</logger>
<root>
<priority value="warn" />
<appender-ref ref="file" />
<!-- <appender-ref ref="console"/> -->
</root>
</log4j:configuration>
You can play with it a little to customize to your needs.