-
1. Re: Logging in JBoss AS 7.1.3.Final within EAR
jamezp Nov 12, 2012 12:22 PM (in response to fcorneli)Do you have a logging configuration file in your EAR?
--
James R. Perkins
-
2. Re: Logging in JBoss AS 7.1.3.Final within EAR
fcorneli Nov 12, 2012 3:32 PM (in response to jamezp)No, I have no logging configuration within my EAR at all. I've already tried adding commons-logging-api to the WARs, EAR/lib, even no commons-logging-api at all, but in that case with a jboss-deployment-structure.xml under EAR/META-INF containing:
<jboss-deployment-structure> <ear-subdeployments-isolated>false</ear-subdeployments-isolated> <deployment> <dependencies> <module name="org.apache.commons.logging" /> <module name="org.jboss.logging"/> <module name="org.jboss.logmanager" /> <module name="javax.faces.api"/> </dependencies> </deployment> </jboss-deployment-structure>
None of these configs give me a working logging. It's really weird. I'm at Devoxx this week, so if anyone feels tempted to try this one out on my machine, please be my guest...
-
3. Re: Logging in JBoss AS 7.1.3.Final within EAR
fcorneli Nov 12, 2012 3:43 PM (in response to fcorneli)I've tried this out on JBoss AS 7.1.1.Final and JBoss AS 7.1.2.Final. Seems like this is a regression starting from JBoss AS 7.1.2.Final.
-
4. Re: Logging in JBoss AS 7.1.3.Final within EAR
jamezp Nov 12, 2012 4:24 PM (in response to fcorneli)If there is no logging configuration file in your deployment, the only other thing I can think of is the categories aren't matching up. If you're using the Class<?> static factory method, then your package would need to the be same as your category in the configuration.
Log LOG = LogFactory.getLog(MyServlet.class);
Should be the equivalent of:
Log LOG = LogFactory.getLog(MyServlet.class.getName());
--
James R. Perkins
-
5. Re: Logging in JBoss AS 7.1.3.Final within EAR
fcorneli Nov 12, 2012 11:51 PM (in response to jamezp)I also checked the category names.
-
6. Re: Logging in JBoss AS 7.1.3.Final within EAR
jamezp Nov 13, 2012 1:04 PM (in response to fcorneli)I modified the ejb-in-ear quickstart to log a debug message and it seemed to work for me. Is there a sample application/source you could attach?
--
James R. Perkins
-
7. Re: Logging in JBoss AS 7.1.3.Final within EAR
fcorneli Nov 13, 2012 9:54 PM (in response to jamezp)Unfortunately this one is closed source. The EAR contains a model EJB JAR (EJB/JPA), an admin portal WAR (CDI/JSF/Primefaces), an end-user portal WAR (CDI/JSF/PrimeFaces), a RESTy web service WAR (CDI/JSF/PrimeFaces/JAX-RS), and a demo web portal WAR (CDI/JSF/PrimeFaces). But anyway, I'll try to strip down the application and see from which point it starts to go wrong.
-
8. Re: Logging in JBoss AS 7.1.3.Final within EAR
fcorneli Nov 13, 2012 10:58 PM (in response to jamezp)mmm... just a WAR within the EAR gives me logging in both servlets and CDI via commons-logging, jboss-logging and java util logging. Adding the following dependency under EAR/lib and I already lose some logging:
<dependency> <groupId>org.apache.ws.security</groupId> <artifactId>wss4j</artifactId> <version>1.6.4</version> </dependency>
wss4j depends on opensaml -> ... -> slf4j, although not included in the actual EAR. Adding "org.slf4j" as module dependency to META-INF/jboss-deployment-structure.xml didn't work for me.
Getting logging in Java EE enabled under JBoss AS shouldn't be this hard, no?
-
9. Re: Logging in JBoss AS 7.1.3.Final within EAR
jamezp Nov 13, 2012 11:25 PM (in response to fcorneli)No, not at all. Especially with 7.1.3 and higher. It should just work. You shouldn't have to exclude or include any of the major logging libraries. I'll give it some testing in the morning and post the results back here.
--
James R. Perkins
-
10. Re: Logging in JBoss AS 7.1.3.Final within EAR
jamezp Nov 13, 2012 11:27 PM (in response to fcorneli)One possible thought, try adding the org.jboss.as.logging.per-deployment=false system property. Maybe that library has a logging configuration file in it which is changing/disabling your logging.
--
James R. Perkins
-
11. Re: Logging in JBoss AS 7.1.3.Final within EAR
fcorneli Nov 14, 2012 3:39 AM (in response to jamezp)It seems really tricky to keep the logging stable. As soon as I use a dependency that JBoss also offers as module (for example joda-time), I run into trouble. Excluding the dependency and declaring the module in jboss-deployment-structure.xml helps. But I guess this is not maintainable as some of my dependencies conflict with the versions of these provided by JBoss AS modules.
-
12. Re: Logging in JBoss AS 7.1.3.Final within EAR
jaikiran Nov 14, 2012 7:06 AM (in response to fcorneli)Would it be possible for you to create a simple application which reproduces this? It shouldn't be this hard to setup logging for an application.
-
13. Re: Logging in JBoss AS 7.1.3.Final within EAR
alex.alvarez. Jun 20, 2013 9:19 AM (in response to jaikiran)I am having a similar issue, when I debug I can navigate to the parent logger but it does not have the right handlers (which I have configured in standalone.xml), if i use the web console i can see that the logging configuration is correct. My deployment-structure looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<exclusions>
<module name="org.apache.commons.io" />
<module name="org.apache.commons-fileupload" />
</exclusions>
<dependencies>
<module name="org.slf4j" export="true" />
<module name="org.slf4j.ext" export="true" />
<module name="org.jboss.logging" export="true" />
</dependencies>
</deployment>
</jboss-deployment-structure>
-
14. Re: Logging in JBoss AS 7.1.3.Final within EAR
jamezp Jun 21, 2013 1:55 PM (in response to alex.alvarez.)Do you have a logging configuration file in your deployment by chance? You could try setting the org.jboss.as.logging.per-deployment system property to false to see if that solves your issue.
--
James R. Perkins