log4j properties file/classloader issues when running from Idea


One (hopefully) quick question I have as a relative newcomer to Idea - my project uses log4j in a very simple way, by a properties file that defines an appender etc. This properties file lives in $PROJECT_ROOT/etc and is copied to classes/ by the ant build. This all works fine from ant and when the war/ear/etc is deployed, but in Idea I don't see any printing. Instead I get error messages from log4j like the following:

log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
log4j:ERROR whereas object of type
log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by .
log4j:ERROR Could not instantiate appender named "A1".

It looks like I may need to do something a bit more IDE-specific to get this to work in the Idea console. Any ideas?



Please sign in to leave a comment.