Enable logging for loading JBOSS classes

How to enable logging to debug problems with loading classes in JBoss 5.x. If JBOSS_HOME / server / xxxxx / conf is configured to configure jboss-log4j.xml, we need to add some piece of code or some other way to enable tracing.

+4
source share
3 answers

You can enable logging in two places:

  • In the JVM - you just have to pass the optional -verbose:class switch. You can put this switch in your run.conf file in the definition of the JAVA_OPTS variable.

  • Enable logging in the jboss-log4j.xml file. You should put the following definition in the file:

     <category name="org.jboss.classloader"> <priority value="DEBUG"/> </category> 
+7
source

It worked for me. I added as shown below.

 <appender name="CLASSLOADING" class="org.jboss.logging.appender.RollingFileAppender"> <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/> <param name="File" value= "${jboss.server.log.dir}/classloading.log"/> <param name="Append" value="false"/> <param name="MaxFileSize" value="5000KB"/> <param name="MaxBackupIndex" value="10"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d %m%n"/> </layout> </appender> <category name="org.jboss.classloading"> <priority value="TRACE"/> <appender-ref ref="CLASSLOADING"/> </category> 
+1
source

You can also enable logs on the command line or pass parameters to the JBoss server using the IDE as:

 set "JAVA_OPTS=%JAVA_OPTS% -Xms2048m -Xmx4096m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dorg.apache.camel.jmx.disabled=true -Djboss.server.log.threshold=DEBUG -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000" 

Here we also increase memory, since writing debugging results to a file / console increases memory consumption. Sometimes, if we do not increase memory, this causes a permGem error.

0
source

All Articles