Examples of PropertyConfigurator


Examples of org.apache.log4j.PropertyConfigurator

  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

Examples of org.apache.log4j.PropertyConfigurator

        // Check thr file name
        String filename = url.getFile().toLowerCase();
        if (filename.endsWith(".xml")) {
            return new DOMConfigurator();
        } else if (filename.endsWith(".properties")) {
            return new PropertyConfigurator();
        }

        // Check for <?xml in content
        if (connection != null) {
            try {
                BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                try {
                    String head = reader.readLine();
                    if (head.startsWith("<?xml")) {
                        return new DOMConfigurator();
                    }
                } finally {
                    reader.close();
                }
            } catch (IOException e) {
                log.warn("Failed to check content header; ignoring", e);
            }
        }

        log.warn("Unable to determine content type, using property configurator");
        return new PropertyConfigurator();
    }
View Full Code Here

Examples of org.apache.log4j.PropertyConfigurator

     */
    public PluginLogManager(Plugin plugin, Properties properties) {
        fLog = plugin.getLog();
        fHierarchy = new Hierarchy(new RootLogger(Level.DEBUG));
        fHierarchy.addHierarchyEventListener(new LogListener());
        new PropertyConfigurator().doConfigure(properties, fHierarchy);

        PluginLogManagerRegistry.getInstance().addLogManager(this);
    }
View Full Code Here

Examples of org.apache.log4j.PropertyConfigurator

        getLogger().error("Could not instantiate configurator [" + clazz + "].");

        return;
      }
    } else {
      configurator = new PropertyConfigurator();
    }

    configurator.doConfigure(url, hierarchy);
  }
View Full Code Here

Examples of org.apache.log4j.PropertyConfigurator

    @AfterClass public static void afterClassResetLogging() {
        // Unfortunately, this code "knows" how log4j was set up in testing
        // Thsi is fragile.
        URL configURL = Loader.getResource("log4j.properties");
        new PropertyConfigurator().doConfigure(configURL,
                                               LogManager.getLoggerRepository());
    }
View Full Code Here

Examples of org.apache.log4j.PropertyConfigurator

        // Check thr file name
        String filename = url.getFile().toLowerCase();
        if (filename.endsWith(".xml")) {
            return new DOMConfigurator();
        } else if (filename.endsWith(".properties")) {
            return new PropertyConfigurator();
        }

        // Check for <?xml in content
        if (connection != null) {
            try {
                BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                try {
                    String head = reader.readLine();
                    if (head.startsWith("<?xml")) {
                        return new DOMConfigurator();
                    }
                } finally {
                    reader.close();
                }
            } catch (IOException e) {
                log.warn("Failed to check content header; ignoring", e);
            }
        }

        log.warn("Unable to determine content type, using property configurator");
        return new PropertyConfigurator();
    }
View Full Code Here

Examples of org.apache.log4j.PropertyConfigurator

    }
  
    if(configFile.endsWith(".xml")) {
      new DOMConfigurator().configure(configFile);
    } else {
      new PropertyConfigurator().configure(configFile);
    }
  }
View Full Code Here

Examples of org.jboss.cache.PropertyConfigurator

      log.info("Starting JBoss Treecache 1.x");

      try
      {
         cache = new TreeCache();
         new PropertyConfigurator().configure(cache, getConfigurationAsStream());
         cache.createService();
         cache.startService();

      }
      catch (Exception e)
View Full Code Here

Examples of org.jboss.cache.PropertyConfigurator

    treeCache = new TreeCache();

    Resource configLocation = getConfigLocation();

    if (configLocation != null) {
      PropertyConfigurator configurator = new PropertyConfigurator();
      configurator.configure(treeCache, configLocation.getInputStream());
    }

    treeCache.createService();
    treeCache.startService();
  }
View Full Code Here

Examples of org.jboss.cache.PropertyConfigurator

      resource = DEFAULT_CONFIG;
    }
    log.debug( "Configuring TreeCache from resource [" + resource + "]" );
    try {
      cache = new org.jboss.cache.TreeCache();
      PropertyConfigurator config = new PropertyConfigurator();
      config.configure( cache, resource );
      TransactionManagerLookup transactionManagerLookup =
          TransactionManagerLookupFactory.getTransactionManagerLookup( properties );
      if ( transactionManagerLookup == null ) {
        throw new CacheException(
            "JBossCache only supports optimisitc locking with a configured " +
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.