-
1. Re: How to separate application logging from server.log in JBossEAP6.2.0
jamezp Aug 25, 2014 7:07 PM (in response to vbharath.kumar)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
-
2. Re: How to separate application logging from server.log in JBossEAP6.2.0
wdfink Aug 26, 2014 12:43 AM (in response to vbharath.kumar)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.
-
3. Re: How to separate application logging from server.log in JBossEAP6.2.0
vbharath.kumar Sep 2, 2014 3:15 AM (in response to jamezp)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.
-
4. Re: How to separate application logging from server.log in JBossEAP6.2.0
renatorro Sep 3, 2014 6:59 PM (in response to vbharath.kumar)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:
<jboss-deployment-structure>
<deployment>
<!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
<exclusions>
<module name="org.apache.log4j" />
</exclusions>
</deployment>
</jboss-deployment-structure>
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.
Regards