Package java.util.logging

Examples of java.util.logging.LogManager$LoggerWeakRef


            if (useShutdownHook) {
                Runtime.getRuntime().removeShutdownHook(shutdownHook);

                // If JULI is being used, re-enable JULI's shutdown to ensure
                // log messages are not lost
                LogManager logManager = LogManager.getLogManager();
                if (logManager instanceof ClassLoaderLogManager) {
                    ((ClassLoaderLogManager) logManager).setUseShutdownHook(
                            true);
                }
            }
View Full Code Here


                ExceptionUtils.handleThrowable(ex);
                log.error(sm.getString("catalina.shutdownHookFail"), ex);
            } finally {
                // If JULI is used, shut JULI down *after* the server shuts down
                // so log messages aren't lost
                LogManager logManager = LogManager.getLogManager();
                if (logManager instanceof ClassLoaderLogManager) {
                    ((ClassLoaderLogManager) logManager).shutdown();
                }
            }
        }
View Full Code Here

        String name = (String) p.getKey();
        String value = ((String[]) p.getValue())[0];

        if (name.equals("submit")) continue;
        Logger logger;
        LogManager logManager = LogManager.getLogManager();
        if ("root".equals(name)) {
          logger = logManager.getLogger("");
        } else logger = logManager.getLogger(name);

        if ("unset".equals(value)) {
          if ((logger != null) && (logger.getLevel() != null)) {
            logger.setLevel(null);
            log.info("Unset log level on '" + name + "'.");
View Full Code Here

    // Use tree to get sorted results
    SortedSet<LogWrapper> roots = new TreeSet<LogWrapper>();

    roots.add(LogWrapper.ROOT);

    LogManager logManager = LogManager.getLogManager();

    Enumeration<String> loggerNames = logManager.getLoggerNames();
    while (loggerNames.hasMoreElements()) {
      String name = loggerNames.nextElement();
      Logger logger = Logger.getLogger(name);
      LogWrapper wrapper = new LogWrapper(logger);
      roots.remove(wrapper); // Make sure add occurs
View Full Code Here

  /**
   * Private method to configure a FileHandler from LogManager properties
   * and/or default values as specified in the class javadoc.
   */
  private void configure() {
    LogManager manager = LogManager.getLogManager();
    String className = getClass().getName();
    LogManagerHelper helper = new LogManagerHelper(manager);
    setPath(helper.getStringProperty(className + ".path", "./logs/${date}"));
    // ".pattern" "%h/java%u.log"
    setDelimiter(helper.getStringProperty(className + ".delimiter", "|||"));
    setLevel(helper.getLevelProperty(className + ".level", Level.ALL));
    setFilter(helper.getFilterProperty(className + ".filter", null));
    setFormatter(helper.getFormatterProperty(className + ".formatter", new SimpleFormatter()));
    try {
      setEncoding(manager.getProperty(className + ".encoding"));
    } catch (Exception ex) {
      try {
        setEncoding(null);
      } catch (Exception ex2) {
      }
View Full Code Here

                ExceptionUtils.handleThrowable(ex);
                log.error(sm.getString("catalina.shutdownHookFail"), ex);
            } finally {
                // If JULI is used, shut JULI down *after* the server shuts down
                // so log messages aren't lost
                LogManager logManager = LogManager.getLogManager();
                if (logManager instanceof ClassLoaderLogManager) {
                    ((ClassLoaderLogManager) logManager).shutdown();
                }
            }
        }
View Full Code Here

                Runtime.getRuntime().addShutdownHook(shutdownHook);
               
                // If JULI is being used, disable JULI's shutdown hook since
                // shutdown hooks run in parallel and log messages may be lost
                // if JULI's hook completes before the CatalinaShutdownHook()
                LogManager logManager = LogManager.getLogManager();
                if (logManager instanceof ClassLoaderLogManager) {
                    ((ClassLoaderLogManager) logManager).setUseShutdownHook(
                            false);
                }
            }
View Full Code Here

            if (useShutdownHook) {
                Runtime.getRuntime().removeShutdownHook(shutdownHook);

                // If JULI is being used, re-enable JULI's shutdown to ensure
                // log messages are not lost
                LogManager logManager = LogManager.getLogManager();
                if (logManager instanceof ClassLoaderLogManager) {
                    ((ClassLoaderLogManager) logManager).setUseShutdownHook(
                            true);
                }
            }
View Full Code Here

     * configuration: it allows configure one root handler with its parameters. What is even more dummy, JUL
     * does not allow to iterate over configuration properties to make interpretation automated (e.g. using
     * commons-beanutils)
     */
    private void configure() {
        LogManager manager = LogManager.getLogManager();
        String cname = getClass().getName();
        AtomPushEngineConfigurator conf = new AtomPushEngineConfigurator();
        conf.setUrl(manager.getProperty(cname + ".url"));
        conf.setDelivererClass(manager.getProperty(cname + ".deliverer"));
        conf.setConverterClass(manager.getProperty(cname + ".converter"));
        conf.setBatchSize(manager.getProperty(cname + ".batchSize"));
        conf.setBatchCleanupTime(manager.getProperty(cname + ".batchCleanupTime"));
        conf.setRetryPause(manager.getProperty(cname + ".retry.pause"));
        conf.setRetryPauseTime(manager.getProperty(cname + ".retry.pause.time"));
        conf.setRetryTimeout(manager.getProperty(cname + ".retry.timeout"));
        conf.setOutput(manager.getProperty(cname + ".output"));
        conf.setMultiplicity(manager.getProperty(cname + ".multiplicity"));
        conf.setFormat(manager.getProperty(cname + ".format"));
        engine = conf.createEngine();
    }
View Full Code Here

        server.start();
    }

    /** Configures global logging */
    private static void configureLogging(String propFile) throws Exception {
        LogManager lm = LogManager.getLogManager();
        InputStream ins = JAXRSLoggingAtomPushTest.class.getResourceAsStream(propFile);
        String s = IOUtils.readStringFromStream(ins);
        ins.close();
        s = s.replaceAll("9080", PORT);
        lm.readConfiguration(new ByteArrayInputStream(s.getBytes("UTF-8")));
    }
View Full Code Here

TOP

Related Classes of java.util.logging.LogManager$LoggerWeakRef

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.