Package java.util.logging

Examples of java.util.logging.LogManager$LogNode


  /**
   * Instantiates a new pattern formatter.
   */
  public PatternFormatter()
  {
    LogManager manager = LogManager.getLogManager();
    String cname = getClass().getName();

    timeFormat = manager.getProperty(cname + ".timeFormat");

    if (timeFormat == null)
    {
      timeFormat = "dd-MMM-yyy; HH:mm:ss";
    }
    setTimeFormat(timeFormat);

    logPattern = manager.getProperty(cname + ".logPattern");
    if (logPattern == null)
    {
      logPattern = "[{0} - {1}] {2}: {3} \n";
    }
    setLogPattern(logPattern);

    exceptionPattern = manager.getProperty(cname + ".exceptionPattern");
    if (exceptionPattern == null)
    {
      exceptionPattern = "[{0} - {1}] {2} {3} \nException in {4}: {6} \n{7} ";
    }
    setExceptionPattern(exceptionPattern);
View Full Code Here


            } catch (Throwable 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

            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

                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

    fileHandler = getConfiguredTarget();
    memoryHandler = new DecoratedMemoryHandler(fileHandler, getConfiguredSize(), getConfiguredPushLevel());
  }

  private static Level getConfiguredPushLevel() {
    LogManager manager = LogManager.getLogManager();
    String pushLevelText = manager.getProperty(ErrorTriggeredFileHandler.class.getName() + ".push");
    if (pushLevelText == null) {
      return DEFAULT_PUSH_LEVEL;
    }
    try {
      return Level.parse(pushLevelText.trim());
View Full Code Here

      return DEFAULT_PUSH_LEVEL;
    }
  }

  protected static int getConfiguredSize() {
    LogManager manager = LogManager.getLogManager();
    String sizeText = manager.getProperty(ErrorTriggeredFileHandler.class.getName() + ".size");
    if (sizeText == null) {
      return DEFAULT_SIZE;
    }
    try {
      return Integer.parseInt(sizeText.trim());
View Full Code Here

      return DEFAULT_SIZE;
    }
  }

  protected static FileHandler getConfiguredTarget() throws SecurityException, IOException {
    LogManager manager = LogManager.getLogManager();
    String pattern = manager.getProperty(ErrorTriggeredFileHandler.class.getName() + ".pattern");
    if (pattern == null) {
      pattern = DEFAULT_PATTERN;
    }
    return new FileHandler(pattern);
  }
View Full Code Here

TOP

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

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.