Bear in mind log4j only does static initialisation if you supply log4j.configuration system property or have log4j.properties in your classpath. If you are using servlet or IoC-container based initialisation you might well have your server/container trying to log something while the log4j initialisation is still to be done. That is when those messages are popping up. As a fix you can put "global" log4j.properties file with logging switched off into your classpath and it will be picked up by main ClassLoader but have specific config and initialisation for your application.
And do not forget to take a look at the manual