Package org.apache.log4j.spi

Examples of org.apache.log4j.spi.RootCategory


  Hierarchy genericHierarchy() {
    if(genericHierarchy == null) {
      File f = new File(dir, GENERIC+CONFIG_FILE_EXT);
      if(f.exists()) {
  genericHierarchy = new Hierarchy(new RootCategory(Priority.DEBUG));
  new PropertyConfigurator().doConfigure(f.getAbsolutePath(), genericHierarchy);
      } else {
  cat.warn("Could not find config file ["+f+
     "]. Will use the default hierarchy.");
  genericHierarchy = Category.getDefaultHierarchy();
View Full Code Here


    t = Category.exists("a.b.c"); assertSame(a_b_c, t);
  }

  public
  void testHierarchy1() {
    Hierarchy h = new Hierarchy( new RootCategory(Priority.ERROR));
    Category a0 = h.getInstance("a");
    assertEquals("a", a0.getName());
    assertNull(a0.getPriority());
    assertSame(Priority.ERROR, a0.getChainedPriority());
View Full Code Here

         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)
      {
View Full Code Here

    public Log4JConfAdapter()
    {
        /**
         * Copied from org.apache.log4j.LogManager.
         */
        super( new Hierarchy( new RootCategory( Level.ALL ) ) );
    }
View Full Code Here

    public Log4JConfAdapter()
    {
        /**
         * Copied from org.apache.log4j.LogManager.
         */
        super( new Hierarchy( new RootCategory( Level.ALL ) ) );
    }
View Full Code Here

                    LOG4J_CONFIG_FILE_DEFAULT);
            log4jFile = getRealPath(log4jFile);
            Properties p = new Properties();
            p.load(new FileInputStream(log4jFile));
            p.setProperty(APPLICATION_ROOT_KEY, context.getApplicationRoot());
            Hierarchy h = new Hierarchy(new RootCategory(Level.INFO));
            new PropertyConfigurator().doConfigure(p,h);
            IsolatedLog4JLogger.setHierarchy(h);
           
            log.info("Configured log4j from " + log4jFile);
            log.info("Starting Jetspeed Engine ("+getClass().getName()+") at "+format.format(startTime));
View Full Code Here

                    LOG4J_CONFIG_FILE_DEFAULT);
            log4jFile = getRealPath(log4jFile);
            Properties p = new Properties();
            p.load(new FileInputStream(log4jFile));
            p.setProperty(APPLICATION_ROOT_KEY, context.getApplicationRoot());
            Hierarchy h = new Hierarchy(new RootCategory(Level.INFO));
            new PropertyConfigurator().doConfigure(p,h);
            IsolatedLog4JLogger.setHierarchy(h);
           
            log.info("Configured log4j from " + log4jFile);
            log.info("Starting Jetspeed Engine ("+getClass().getName()+") at "+format.format(startTime));
View Full Code Here

            theSelector = new MyRepositorySelector();
            LogManager.setRepositorySelector(theSelector, null);
            initialized = true;
        }

        Hierarchy hierarchy = new Hierarchy(new RootCategory(Level.ERROR));

        loadLog4JConfig(config, hierarchy);
        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        repositories.put(loader, hierarchy);
    }
View Full Code Here

         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)
      {
View Full Code Here

TOP

Related Classes of org.apache.log4j.spi.RootCategory

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.