Package org.apache.log4j

Examples of org.apache.log4j.Hierarchy


    void addRepository(ClassLoader cl) {
  if( ht.get(cl) != null ) {
      throw new IllegalStateException("ClassLoader " + cl + " already registered");
  }
  ht.put(cl, new Hierarchy(new RootCategory( defLevel)));
    }
View Full Code Here


    }
        
    // the returned value is guaranteed to be non-null
    public LoggerRepository getLoggerRepository() {
  ClassLoader cl = Thread.currentThread().getContextClassLoader();
  Hierarchy hierarchy = (Hierarchy) ht.get(cl);
 
  if(hierarchy == null) {
      hierarchy = new Hierarchy(new RootCategory(defLevel));
      ht.put(cl, hierarchy);
  }
  return hierarchy;
    }
View Full Code Here

    if (loggingContextName == null || Constants.DEFAULT_REPOSITORY_NAME.equals(loggingContextName)) {
      return LogManager.defaultLoggerRepository;
    } else {
      //System.out.println("loggingContextName is ["+loggingContextName+"]");
      Hierarchy hierarchy = (Hierarchy) hierMap.get(loggingContextName);

      if (hierarchy == null) {
        // create new hierarchy
        hierarchy = new Hierarchy(new RootLogger(Level.DEBUG));
        hierarchy.setName(loggingContextName);
        hierMap.put(loggingContextName, hierarchy);

        // configure log4j internal logging
        IntializationUtil.log4jInternalConfiguration(hierarchy);
View Full Code Here

        if ((logpath != null) && (logpath.trim().length() != 0))
        {
            logfile = logpath + _fs + logfile;
        }
        _creator =
            new Hierarchy(new RootCategory(Logger.getRootLogger()
                .getLevel()));
        try
        {
            new FileInputStream(logfile).close();
            new PropertyConfigurator().doConfigure(logfile, _creator);
View Full Code Here

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

    if (loggingContextName == null) {
      return defaultRepository;
    } else {
      System.out.println("loggingContextName is ["+loggingContextName+"]");
      Hierarchy hierarchy = (Hierarchy) hierMap.get(loggingContextName);

      if (hierarchy == null) {
        // create new hierarchy
        hierarchy = new Hierarchy(new RootLogger(Level.DEBUG));
        hierarchy.setName(loggingContextName);
        hierMap.put(loggingContextName, hierarchy);

        // configure log4j internal logging
        IntializationUtil.log4jInternalConfiguration(hierarchy);
View Full Code Here

        LoggerRepository repository = this.repository.get(ccl == null ? NO_CCL_CLASSLOADER : ccl.hashCode());
        if (repository == null)
        {
            final RootLogger root = new RootLogger(Level.INFO);
            repository = new Hierarchy(root);

            try
            {
                ConfigWatchDog configWatchDog = null;
                if (ccl instanceof MuleApplicationClassLoader)
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());

    Category a1 = h.getInstance("a");
    assertSame(a0, a1);

   

   
View Full Code Here

                if ( waRootKey == null || waRootKey.length() == 0 )
                {
                    waRootKey = LOG4J_CONFIG_WEB_APPLICATION_ROOT_KEY_DEFAULT;
                }
                p.setProperty(waRootKey,rootPath);
                isolatedHierarchy = new Hierarchy(new RootCategory(Level.INFO));
                new PropertyConfigurator().doConfigure(p,isolatedHierarchy);
                IsolatedLog4JLogger.setHierarchy(isolatedHierarchy);
                log = LogFactory.getLog(this.getClass());
                log.info("IsolatedLog4JLogger configured");
            }
View Full Code Here

  cat.info("Waiting to accept a new client.");
  Socket socket = serverSocket.accept();
  InetAddress inetAddress =  socket.getInetAddress();
  cat.info("Connected to client at " + inetAddress);

  Hierarchy h = (Hierarchy) server.hierarchyMap.get(inetAddress);
  if(h == null) {
    h = server.configureHierarchy(inetAddress);
  }

  cat.info("Starting new socket node.")
View Full Code Here

TOP

Related Classes of org.apache.log4j.Hierarchy

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.