Class JDKXRLogger

java.lang.Object
org.xhtmlrenderer.util.JDKXRLogger
All Implemented Interfaces:
XRLogger

public class JDKXRLogger extends Object implements XRLogger
An XRLogger interface that uses java.util.logging.
  • Constructor Details

    • JDKXRLogger

      public JDKXRLogger()
  • Method Details

    • log

      public void log(String where, Level level, String msg)
      Specified by:
      log in interface XRLogger
    • log

      public void log(String where, Level level, String msg, @Nullable Throwable th)
      Specified by:
      log in interface XRLogger
    • setLevel

      public void setLevel(String logger, Level level)
      Specified by:
      setLevel in interface XRLogger
    • getLogger

      @CheckReturnValue private static Logger getLogger(String log)
      Same purpose as Logger.getLogger(), except that the static initialization for XRLog will initialize the LogManager with logging levels and other configuration. Use this instead of Logger.getLogger()
    • retrieveLoggingProperties

      @CheckReturnValue private static Properties retrieveLoggingProperties()
    • initializeJDKLogManager

      private static void initializeJDKLogManager(Properties fsLoggingProperties)
    • configureLoggerHandlerForwarding

      private static void configureLoggerHandlerForwarding(Properties fsLoggingProperties, List<Logger> loggers)
    • assignFormatter

      private static void assignFormatter(Map<String,Handler> handlers, String handlerClassName, String formatterClassName)
    • retrieveLoggers

      @CheckReturnValue private static List<Logger> retrieveLoggers()
      Returns a List of all Logger instances used by Flying Saucer from the JDK LogManager; these will be automatically created if they aren't already available.
    • configureLogHandlers

      @CheckReturnValue private static Map<String,Handler> configureLogHandlers(List<Logger> loggers, String handlerClassList)
      For each logger provided, assigns the logger an instance of the named log output handlers. Will attempt to instantiate each handler; any which can't be instantiated will cause the method to throw a RuntimeException.
      Parameters:
      loggers - List of Logger instances.
      handlerClassList - A space-separated string (following the configuration convention for JDK logging configuration files, for handlers) of FQN of log handlers.
      Returns:
      Map of handler class names to handler instances.
    • configureLogLevel

      private static void configureLogLevel(String loggerName, String levelValue)
      Parses the levelValue into a Level instance and assigns to the Logger instance named by loggerName; if the levelValue is invalid (e.g. misspelled), assigns Level.OFF to the logger.