Examples of RootLogger


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

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

            }
        }
    }

    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

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

        final ClassLoader ccl = Thread.currentThread().getContextClassLoader();

        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)
                {
                    MuleApplicationClassLoader muleCL = (MuleApplicationClassLoader) ccl;
                    // check if there's an app-specific logging configuration available,
                    // scope the lookup to this classloader only, as getResource() will delegate to parents
                    // locate xml config first, fallback to properties format if not found
                    URL appLogConfig = muleCL.findResource("log4j.xml");
                    if (appLogConfig == null)
                    {
                        appLogConfig = muleCL.findResource("log4j.properties");
                    }
                    final String appName = muleCL.getAppName();
                    if (appLogConfig == null)
                    {
                        // fallback to defaults
                        String logName = String.format("mule-app-%s.log", appName);
                        File logDir = new File(MuleContainerBootstrapUtils.getMuleHome(), "logs");
                        File logFile = new File(logDir, logName);
                        DailyRollingFileAppender fileAppender = new DailyRollingFileAppender(new PatternLayout(PATTERN_LAYOUT), logFile.getAbsolutePath(), "'.'yyyy-MM-dd");
                        fileAppender.setAppend(true);
                        fileAppender.activateOptions();
                        root.addAppender(fileAppender);
                    }
                    else
                    {
                        configureFrom(appLogConfig, repository);
                        if (appLogConfig.toExternalForm().startsWith("file:"))
View Full Code Here

Examples of org.apache.log4j.spi.RootLogger

     * @param xmlProperties
     *            Needs to be an XML file.
     */
    public PluginLogManager(Plugin plugin, URL xmlProperties) {
        fLog = plugin.getLog();
        fHierarchy = new Hierarchy(new RootLogger(Level.DEBUG));
        fHierarchy.addHierarchyEventListener(new LogListener());
        new DOMConfigurator().doConfigure(xmlProperties, fHierarchy);

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

Examples of org.apache.log4j.spi.RootLogger

     * @param properties
     *            the properties file
     */
    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.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

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

  public
  void testHierarchy1() {
    Hierarchy h = new Hierarchy(new RootLogger(Level.ERROR));
    Logger a0 = h.getLogger("a");
    assertEquals("a", a0.getName());
    assertNull(a0.getLevel());
    assertSame(Level.ERROR, a0.getEffectiveLevel());
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.