类 LoggingSystem

    • 方法详细资料

      • initialize

        public void initialize​(LoggingInitializationContext initializationContext,
                               String configLocation,
                               LogFile logFile)
        Fully initialize the logging system.
        参数:
        initializationContext - the logging initialization context
        configLocation - a log configuration location or null if default initialization is required
        logFile - the log output file that should be written or null for console only output
      • cleanUp

        public void cleanUp()
        Clean up the logging system. The default implementation does nothing. Subclasses should override this method to perform any logging system-specific cleanup.
      • getShutdownHandler

        public Runnable getShutdownHandler()
        Returns a Runnable that can handle shutdown of this logging system when the JVM exits. The default implementation returns null, indicating that no shutdown is required.
        返回:
        the shutdown handler, or null
      • setLogLevel

        public void setLogLevel​(String loggerName,
                                LogLevel level)
        Sets the logging level for a given logger.
        参数:
        loggerName - the name of the logger to set (null can be used for the root logger).
        level - the log level (null can be used to remove any custom level for the logger and use the default configuration instead)
      • get

        public static LoggingSystem get​(ClassLoader classLoader)
        Detect and return the logging system in use. Supports Logback and Java Logging.
        参数:
        classLoader - the classloader
        返回:
        the logging system