wangscript / warp-persist

Automatically exported from code.google.com/p/warp-persist
0 stars 0 forks source link

log4j:WARN No appenders could be found for logger #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the test target in ant
2. you get the warning lines:
log4j:WARN No appenders could be found for logger
(org.hibernate.cfg.annotations.Version).
log4j:WARN Please initialize the log4j system properly.

What is the expected output? What do you see instead?
Those warning lines should not appear.
I resolved this by creating and adding a 'commons-logging.properties' file
into the src directory. This file just contains one line:
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger

Then i copy it into the build directory within the init ant target, like this:
    <target name="init" description="sets up build dirs">
        <mkdir dir="${build}"/>
        <mkdir dir="${dist}"/>
        <mkdir dir="${test}"/>
        <!-- to avoid hibernate commons-logging's log4j warning -->
        <copyfile src="src/commons-logging.properties"
dest="${build}/commons-logging.properties"/>
    </target>

see: http://jakarta.apache.org/commons/logging/guide.html#Configuration

What version of the product are you using? On what operating system?
warp-persist svn latest checkout (read-only).
Windows XP

Please provide any additional information below.

Original issue reported on code.google.com by max.cald...@gmail.com on 4 Nov 2009 at 1:57

GoogleCodeExporter commented 9 years ago
This is really a user-side issue with hibernate, wp doesn't even mandate 
hibernate so it 
would be poor form for us to specify commons logging defaults to suppress its 
default 
warnings.

You could add that line in your app's ant script, where it ideally belongs.

Original comment by dha...@gmail.com on 4 Nov 2009 at 4:19