The log4j config file is expected to be in the classpath of the application. I guess the root of the .ear used to be in the classpath for 4.2.x.
For AS-5, try moving that file to .ear/lib folder (if you don't have an .ear/lib folder, then create one). See if that works.
Nothing changed when I have moved file to lib.
I guess almost all enterprise applications have log4j set up some how. Anyone got it working? Is my problem just file placement or could it be something else, ie. initialize/configure Log4j from my code?
Can someone confirm it is enough to put file on classpath, or there is more to it?
I'm not sure if this response comes in late to you. But you can follow the steps to acheive that
1. Package ur log4j.properties inside the EAR so that it is available in the Classpath e.g Root or EAR/libs. Additionally you can also place it inside App-inf/libs but just that in the latter case make sure to have this
in your jboss-app.xml.
2. Over-ride the class-loading(isolation). Like this
3. Package the log4j.jar(ur choice) inside the EAR somewhere @places mentioned in pt.1
4. You are done