0 Replies Latest reply: Jan 25, 2009 8:32 PM by 807588 RSS

    log4j help: disabling org.apache.commons.digester.Digester logs

    807588
      Hi: I am trying to use log4j for the first time to perform logging. I am having one trouble. I want the java application to print some stuff within my code. But it also prints a lot of stuff related to org.apache.commons.digester.Digester in addition to my log statements [DEBUG [main] checkRequest (checkRequest.java)]. The application name is checkRequest. Is there anyway to dsiable the org.apache.commons.digester.Digester logs?

      Here's what I have in the log4j.xml
      ========================
      <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

      <appender name="Console" class="org.apache.log4j.ConsoleAppender">
      <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern"
      value="%d %-5p [%t] %C (%F:%L) - %m%n"/>
      </layout>
      </appender>
      <logger name="com.bmc.arsys">
      <level value="fatal" />
      </logger>

      <!--Set root category priority to fatal -->
      <root>
      <priority value ="debug" />
      <appender-ref ref="Console" />
      </root>

      </log4j:configuration>
      =====================

      Here's my code:
      When I run this code as soon as the code reaches the "server = new ARServerUser" line, I get a lot of logs which I want disable.
      ===========================
      import java.sql.*;
      import java.io.*;
      import java.util.*;
      import java.lang.*;
      import com.bmc.arsys.api.*;
      import javax.mail.*;
      import org.apache.log4j.Logger;
      import org.apache.log4j.Level;


      public class checkRequest {
      private static Logger logger = Logger.getLogger(checkRequest.class);

      public static void main(String args[]){
      String REMENV = args[0];
      logger.debug("Here is some DEBUG");
      if(args.length > 1) {
      String requestID = args[1];
      }

      ARServerUser server = null;

      if(REMENV.equals("TEST")) {
      logger.debug("Connecting to Test remedy");
      server = new ARServerUser("Demo", "r3m3dy", "", "rearsyst01");
      }
      server.logout();

      }
      }
      =========================

      2009-01-25 21:27:51,230 DEBUG [main] checkRequest (checkRequest.java:16) - Here is some DEBUG
      2009-01-25 21:27:51,238 DEBUG [main] checkRequest (checkRequest.java:24) - Connecting to Test remedy
      2009-01-25 21:27:51,429 DEBUG [main] org.apache.commons.configuration.ConfigurationUtils (ConfigurationUtils.java:515) - Configuration loade
      d from the context classpath (arsys_base.xml)
      2009-01-25 21:27:51,537 DEBUG [main] org.apache.commons.digester.Digester (Digester.java:1249) - setDocumentLocator(com.sun.org.apache.xerce
      s.internal.parsers.AbstractSAXParser$LocatorProxy@ccc588)
      2009-01-25 21:27:51,540 DEBUG [main] org.apache.commons.digester.Digester (Digester.java:1283) - startDocument()
      2009-01-25 21:27:51,543 DEBUG [main] org.apache.commons.digester.Digester (Digester.java:1318) - startElement(,,configuration)
      2009-01-25 21:27:51,546 DEBUG [main] org.apache.commons.digester.Digester (Digester.java:1325) - Pushing body text ''
      2009-01-25 21:27:51,549 DEBUG [main] org.apache.commons.digester.Digester (Digester.java:1344) - New match='configuration'
      2009-01-25 21:27:51,552 DEBUG [main] org.apache.commons.digester.Digester (Digester.java:1372) - No rules found matching 'configuration'.
      2009-01-25 21:27:51,555 DEBUG [main] org.apache.commons.digester.Digester (Digester.java:1002) - characters(
      )
      2009-01-25 21:27:51,558 DEBUG [main] org.apache.commons.digester.Digester (Digester.java:1002) - characters(
      )
      2009-01-25 21:27:51,560 DEBUG [main] org.apache.commons.digester.Digester (Digester.java:1318) - startElement(,,xml)
      2009-01-25 21:27:51,562 DEBUG [main] org.apache.commons.digester.Digester (Digester.java:1325) - Pushing body text '

      '
      2009-01-25 21:27:51,564 DEBUG [main] org.apache.commons.digester.Digester (Digester.java:1344) - New match='configuration/xml'
      2009-01-25 21:27:51,567 DEBUG [main] org.apache.commons.digester.Digester (Digester.java:1359) - Fire begin() for FactoryCreateRule[classN
      ame=null, attributeName=null, creationFactory=org.apache.commons.configuration.ConfigurationFactory$FileConfigurationFactory@73a34b]
      2009-01-25 21:27:51,579 INFO [main] org.apache.commons.configuration.ConfigurationFactory$FileConfigurationFactory (ConfigurationFacto


      TIA
      Ravi