Examples of LogManager


Examples of java.util.logging.LogManager

            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

Examples of java.util.logging.LogManager

                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

Examples of java.util.logging.LogManager

    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

Examples of java.util.logging.LogManager

      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

Examples of java.util.logging.LogManager

      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

Examples of java.util.logging.LogManager

        this.setWithStackTrace(withStackTrace);
        this.columns = aColumns;
    }
   
    public SGEFormatter() {
        LogManager manager = LogManager.getLogManager();
       
        String cname = getClass().getName();
       
        String str = manager.getProperty(cname + ".withStacktrace");
        if(str != null) {
            setWithStackTrace(Boolean.valueOf(str).booleanValue());
        }
       
        str = manager.getProperty(cname + ".columns");
       
        if(str != null ) {
            StringTokenizer st = new StringTokenizer(str, " ");
           
            List columns = new ArrayList();
           
            while(st.hasMoreTokens() ) {
                Column col = getColumn(st.nextToken());
                if(col != null) {
                    columns.add(col);
                }
            }
            this.columns = new int[columns.size()];
            for(int i = 0; i < columns.size(); i++) {
                this.columns[i] = ((Column)columns.get(i)).getId();
            }
           
        } else {
            this.columns = DEFAULT_COLUMNS;
        }
       
        str = manager.getProperty(cname + ".name");
        if(str == null) {
            str = "Unknown";
        }
        this.name = name;
    }
View Full Code Here

Examples of java.util.logging.LogManager

        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

Examples of java.util.logging.LogManager

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

Examples of java.util.logging.LogManager

     * Creates an instance of this class.
     *
     * @throws  ClassNotFoundException if the exception class is not found
     */
    public ExceptionFilter() throws ClassNotFoundException {
  LogManager logManager = LogManager.getLogManager();
  String value = logManager.getProperty(EXCEPTION_CLASS_PROPERTY);
  exceptionClass = (value != null)
      ? Class.forName(value).asSubclass(Throwable.class)
      : Throwable.class;
  value = logManager.getProperty(LEVEL_PROPERTY);
  level = (value != null) ? Level.parse(value) : Level.INFO;
    }
View Full Code Here

Examples of java.util.logging.LogManager

    /** Whether to print stack traces. */
    private final boolean printStack;

    /** Creates an instance of this class. */
    public LogFormatter() {
  LogManager logManager = LogManager.getLogManager();
  String value = logManager.getProperty(TIME_FORMAT_PROPERTY);
  timeFormat = (value != null) ? value : DEFAULT_TIME_FORMAT;
  value = logManager.getProperty(PRINT_STACK_PROPERTY);
  printStack = (value == null) || Boolean.parseBoolean(value);
    }
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.