-
1. Re: Stupid problem: no logging period for an EAR file
smokingapipe Jan 15, 2007 10:41 PM (in response to smokingapipe)Btw this is with JBoss 4.0.5.
-
2. Re: Stupid problem: no logging period for an EAR file
smokingapipe Jan 16, 2007 12:39 AM (in response to smokingapipe)I tried putting this:
<Logger className="org.jboss.web.tomcat.Log4jLogger" verbosityLevel="INFO" category="org.jboss.web.localhost.Engine" />
in the web server.xml file for JBoss and that made the whole thing fail.
Hmm, surely logging is possible for applications in JBoss? I just want to do the obvious things: if there is an uncaught exception, log it, and also be able to say logger.severe("somethign happened"). This shouldn't be brain surgery here... -
3. Re: Stupid problem: no logging period for an EAR file
smokingapipe Jan 16, 2007 1:54 AM (in response to smokingapipe)I looked at the jmx-console and looked at the log4j mbean, and set the CatchSystemErr and CatchSystemOut to false, and that didn't seem to change anything. The one thing that does work is (Java 6) System.console().printf(). That cannot be redirected at all from within Java. Unfortunately if I want to see exception traces using that I still need to use try / catch blocks, AND it won't do me any good for looking at exceptions that occur outside my code.
The other alternative is to run a totally separate JBoss instance on another port and don't use virtual hosts at all.
But this all seems absurd. JBoss is such an advanced product, there must be some way to log exceptions and use virtual hosts. -
4. Re: Stupid problem: no logging period for an EAR file
smokingapipe Jan 16, 2007 2:17 AM (in response to smokingapipe)And apparently I'm not the only one who is getting this "there are no logs" problem when using virtual hosts in JBoss:
http://osdir.com/ml/log4j-user@logging.apache.org/msg07435.html//osdir.com/ml/log4j-user@logging.apache.org/msg07435.html -
5. Re: Stupid problem: no logging period for an EAR file
smokingapipe Jan 16, 2007 2:37 AM (in response to smokingapipe)And I set my log4j.xml file to:
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true"> <appender name="console" class="org.apache.log4j.ConsoleAppender"> <param name="Target" value="System.out"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%-5p %c{1} - %m%n"/> </layout> </appender> <root> <priority value ="info" /> <appender-ref ref="console" /> </root> </log4j:configuration>
which should log everything above info level. All my log messages are at "severe" level. None of them show up.
I think this is a bug in JBoss. -
6. Re: Stupid problem: no logging period for an EAR file
smokingapipe Jan 16, 2007 2:53 AM (in response to smokingapipe)On a whim, I was looking around, and saw the server/default/deploy/jbossweb-tomcat55.sar/META-INF/jboss-service.xml file. I edited that file and changed:
<attribute name="FilteredPackages">javax.servlet,org.apache.commons.logging</attribute>
to:<attribute name="FilteredPackages">javax.servlet,org</attribute>
and restarted and it WORKED in the sense that I suddenly saw a ton of web app log messages. But what didn't work is that I now got class loader violations because it was trying to load commons logging twice. Not good.
But this is progress. It tells me that I might be able to succeed by purging my application of any classes in org.apache.commons.logging and then changing that attribute. -
7. Re: Stupid problem: no logging period for an EAR file
smokingapipe Jan 16, 2007 1:13 PM (in response to smokingapipe)Any ideas? Surely I'm not the first person to notice this?
-
8. Re: Stupid problem: no logging period for an EAR file
smokingapipe Jan 17, 2007 12:14 AM (in response to smokingapipe)Problem solved: One of the webapps deployed on that JBoss installation was doing something insane to the logging system and stopped it from logging anything.
It would be ideal if there were some mechanism that would block webapps from misbehaving like that. Anyway, that was the problem. The offending app was the Claros email system.