Package org.apache.log4j

Examples of org.apache.log4j.PropertyConfigurator


/* 177 */     File configFile = new File(this.dir, key + CONFIG_FILE_EXT);
/* 178 */     if (configFile.exists()) {
/* 179 */       Hierarchy h = new Hierarchy(new RootLogger((Level)Priority.DEBUG));
/* 180 */       this.hierarchyMap.put(inetAddress, h);
/*     */
/* 182 */       new PropertyConfigurator().doConfigure(configFile.getAbsolutePath(), h);
/*     */
/* 184 */       return h;
/*     */     }
/* 186 */     cat.warn("Could not find config file [" + configFile + "].");
/* 187 */     return genericHierarchy();
View Full Code Here


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

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

      new DOMConfigurator();
      DOMConfigurator.configure(str5);
    }
    else
    {
      new PropertyConfigurator();
      PropertyConfigurator.configure(str5);
    }
    new JMSSink(str1, str2, str3, str4);
    BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Type \"exit\" to quit JMSSink.");
View Full Code Here

        // 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

            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

        // 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

      if (localObject == null)
        LogLog.error("Could not instantiate configurator [" + paramString + "].");
    }
    else
    {
      localObject = new PropertyConfigurator();
    }
    ((Configurator)localObject).doConfigure(paramURL, paramLoggerRepository);
  }
View Full Code Here

  public static final String LOG4J_JSON_CUSTOM_OBJECT_PATH = System.getProperty(
      "log4j.json.custom.object.path", null);

  @Override
  public void doConfigure(URL url, LoggerRepository repository) {
    new PropertyConfigurator().doConfigure(getProperties(url), repository);
  }
View Full Code Here

  public void doConfigure(URL url, LoggerRepository repository) {
    new PropertyConfigurator().doConfigure(getProperties(url), repository);
  }

  void doConfigure(JSONObject json, LoggerRepository repository) {
    new PropertyConfigurator().doConfigure(getProperties(json), repository);
  }
View Full Code Here

TOP

Related Classes of org.apache.log4j.PropertyConfigurator

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.