Examples of RootLogger


Examples of org.apache.log4j.spi.RootLogger

    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

Examples of org.apache.log4j.spi.RootLogger

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

Examples of org.apache.log4j.spi.RootLogger

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

  public
  void testHierarchy1() {
    Hierarchy h = new Hierarchy(new RootLogger((Level) Level.ERROR));
    Logger a0 = h.getLogger("a");
    assertEquals("a", a0.getName());
    assertNull(a0.getLevel());
    assertSame(Level.ERROR, a0.getEffectiveLevel());
View Full Code Here

Examples of org.apache.log4j.spi.RootLogger

                    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

Examples of org.apache.log4j.spi.RootLogger

    } 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

Examples of org.apache.log4j.spi.RootLogger

  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

Examples of org.apache.log4j.spi.RootLogger

   * Performs any necessary initialisation.
   */
  private void init() {
    if (appender == null) {
      // need to create a new log4j hierarchy so values in log4j.xml are ignored
      observerLogger = new Hierarchy(new RootLogger(Level.DEBUG)).getLogger(this.getClass().getName());
      PatternLayout layout = new PatternLayout();
      layout.setConversionPattern(conversionPattern);
      try {
        appender = new RollingFileAppender(layout, baseLogPath + jobRunId + ".log");
        appender.setMaxBackupIndex(maxBackupIndex);
View Full Code Here

Examples of org.apache.log4j.spi.RootLogger

/*     */     }
/* 175 */     String key = s.substring(0, i);
/*     */
/* 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;
View Full Code Here

Examples of org.apache.log4j.spi.RootLogger

/*     */   LoggerRepository genericHierarchy()
/*     */   {
/* 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

Examples of org.apache.log4j.spi.RootLogger

            }
        }
    }

    private Logger getAlternateLogger(Writer writer, ThrowableRenderer renderer) {
        Hierarchy hierarchy = new Hierarchy(new RootLogger(Level.INFO));
        if (renderer != null) {
            hierarchy.setThrowableRenderer(renderer);
        }
        Logger alternateRoot = hierarchy.getRootLogger();
        alternateRoot.addAppender(new WriterAppender(new SimpleLayout(), writer));
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.