Where is your log4j.properties located? If you want the server to configure it it needs to be in the META-INF of an EAR or WEB-INF/classes of a WAR.
James R. Perkins
A simple way is to have no logging configuration within the application. Just add a new handler and a logging category wired to this handler for your application. In this case only your handler is used for your applicaton.
The property file is inside source folder structure(src/com/test) and configured in web.xml. i want application level logging..So, please suggest.The same is working fine i deployed in tomcat server.
The JBoss logging is the worst thing i ever seem in the application servers and servlet containers.
The Tomcat doesn't have it's own logging system, so it will load your app configuration fine without any problem.
The EAP scans your deployment for a log4j.properties or log4j.xml. If it founds one of these, the EAP will try to use the configurations in that file, but this doesn't work well.
For example, i coulndn't make the EAP show my app logs in the console, only if i configure it directly in the domain.xml or standalone.xml.
The easiest way i suggest you is to create a new handler in the standalone.xml logging subsystem config. So create a new logger for your apps category and points it to the new file handler that collects all messages coming from your app. For this to work you have to remove your log4j.properties file from the deployment.
Another option that i did not test is to prevent the loading of the logging subsystem via the jboss-deployment-structure.xml file, that must be located at WEB-INF folder, along the web.xml. In the content:
<!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
<module name="org.apache.log4j" />
With this file, you should have to just configure the file appender in your log4j configuration and points your app category to this new appender.
Remember, i didn't test this approach, i see it on the internet. You may have to search some more info out there.