Package org.apache.log4j

Examples of org.apache.log4j.Hierarchy


         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


   {
      if (classloader == null)
      {
         throw new IllegalArgumentException("No classloader provided");
      }
      Hierarchy hierarchy = (Hierarchy)repositories.remove(classloader);
      if (hierarchy != null)
      {
         hierarchy.shutdown();
      }
      else
      {
         System.out.print("No hierarchy found for classloader : ");
         Writer writer = new PrintWriter(System.out);
View Full Code Here

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

    } else {
      String key = s.substring(0, i);

      File configFile = new File(dir, key+CONFIG_FILE_EXT);
      if(configFile.exists()) {
  Hierarchy h = new Hierarchy(new RootLogger(Level.DEBUG));
  hierarchyMap.put(inetAddress, h);

  new PropertyConfigurator().doConfigure(configFile.getAbsolutePath(), h);

  return h;
View Full Code Here

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

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

    super.setUp();
    appendConfigFile = "append-with-drivermanager1.xml";
    readConfigFile = "read-with-drivermanager1.xml";

    witnessEvents = new Vector();
    lrWrite = new Hierarchy(new RootLogger(Level.DEBUG));
    lrRead = new LoggerRepositoryExImpl(new Hierarchy(new RootLogger(Level.DEBUG)));


    //
    //   attempt to define tables in in-memory database
    //      will throw exception if already defined.
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

                    ctx.log("Unable to load custom Log4J configuration class '"
                            + configuratorName + "':  " + ex.getMessage());
                    return;
                }

                configurator.doConfigure(configURL, new Hierarchy(new RootLogger(Level.OFF)));
            }
            else if (configURL.getFile().endsWith(".xml"))
                DOMConfigurator.configure(configURL);
            else
                PropertyConfigurator.configure(configURL);
View Full Code Here

    } else {
      String key = s.substring(0, i);

      File configFile = new File(dir, key+CONFIG_FILE_EXT);
      if(configFile.exists()) {
  Hierarchy h = new Hierarchy(new RootLogger(Level.DEBUG));
  hierarchyMap.put(inetAddress, h);

  new PropertyConfigurator().doConfigure(configFile.getAbsolutePath(), h);

  return h;
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.