Package org.apache.log4j.xml

Examples of org.apache.log4j.xml.DOMConfigurator


    try {
            // Sets log4j for apache commons logging
      LogFactory.getFactory().setAttribute(LogFactoryImpl.LOG_PROPERTY, Log4JLogger.class.getName());
     
      // Gets the log4j properties and use them for the log4j config
      DOMConfigurator configurator = new DOMConfigurator();
      configurator.doConfigure(log4jInputStream, LogManager.getLoggerRepository());
      if (logger.isDebugEnabled()) {
        logger.debug("log4j config param loaded");
      }
    } catch (java.lang.Exception e) {
      System.out.println("error logging log4j config param");
View Full Code Here


      {
         log4JConfig = loader.load(pathToLog4jFile);
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         DocumentBuilder builder = factory.newDocumentBuilder();
         Document doc = builder.parse(log4JConfig);
         DOMConfigurator conf = new DOMConfigurator();

         Hierarchy hierarchy = new Hierarchy(new RootCategory(Level.DEBUG));
         conf.doConfigure(doc.getDocumentElement(), hierarchy);
         repositories.put(classloader, hierarchy);
      }
      catch (Exception e)
      {
         log.error(e);
View Full Code Here

TOP

Related Classes of org.apache.log4j.xml.DOMConfigurator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.