Monday, October 10, 2011

How to bypass dynamo logs from log4J in JBOSS?

By default,  when using JBOSS server ATG overrides
$class with  $class=atg.nucleus.logging.commons.CommonsLoggingLogListener
in \DafEar\Tomcat\config\tomcatconfig.jar/atg/dynamo/service/logging/ScreenLog.properties

So logs with colorizer will be like below (click to enlarge)


If you observe all debugs and infos will be in green and error log is split into multiple lines.
To get back normal and clean dynamo logs with ATG colorizer

If EAR is non-standalone
    In <ATG-HOME>/<LOCALCONFIG>/atg/dynamo/service/logging/ScreenLog.properties
If EAR is standalone
    In <ATG-DATA>/<LOCALCONFIG>/atg/dynamo/service/logging/ScreenLog.properties
have below lines
$class=atg.nucleus.logging.PrintStreamLogger
useNucleusPathForClassName=true
useFullPaths=true
suppressTimestamp=false
and comment log4j section in <JBOSS-HOME>/server/<server-name>/conf/jboss-service.xml
   <!-- Log4j Initialization --> 
   <!--
   <mbean code="org.jboss.logging.Log4jService"
      name="jboss.system:type=Log4jService,service=Logging"
      xmbean-dd="resource:xmdesc/Log4jService-xmbean.xml">
      <attribute name="ConfigurationURL">resource:jboss-log4j.xml</attribute>
      <attribute name="Log4jQuietMode">true</attribute>
      <attribute name="RefreshPeriod">60</attribute>
   </mbean>
   -->
Now you will get plain old dynamo logs - neater and simple. (click to enlarge)


 You can observe the difference between screenshots with same log statements. I feel the later one is better :)

1 comment:

  1. I like the LogColorizer colors better, but useful information anyway here!

    ReplyDelete