Class SystemLogger

  • All Implemented Interfaces:
    ResolverLogger

    public class SystemLogger
    extends AbstractLogger
    The system logger interfaces to a logging backend via a logging backend.

    This class supports either configuration with org.slf4j.Logger or configuration directly with a java.util.logging.Logger.

    This logger makes it easy to configure the resolver to log through a standard logging framework, as might be present on a Java application server. By default the logger uses the org.slf4j.LoggerFactory to create a logger. This logger can be supported at runtime by a wide variety of concrete backend classes. For details on how SLF4J finds a logging backend, see their documentation.

    Alternatively, if you instantiate the SystemLogger with a java.util.logging.Logger directly, it will use that.

    When instantiated with the ResolverFeature.RESOLVER_LOGGER_CLASS, the default logging framework is always used. To use the Logger alternative, you must instantiate the logger yourself and set the ResolverFeature.RESOLVER_LOGGER feature yourself.

    • Constructor Summary

      Constructors 
      Constructor Description
      SystemLogger​(java.util.logging.Logger log)
      Initialize the logger using an explicit Logger.
      SystemLogger​(ResolverConfiguration config)
      Initialize the logger using the default backend.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void debug​(java.lang.String message)
      Process a debug message with the underlying logging framework.
      void info​(java.lang.String message)
      Process an informational message with the underlying logging framework.
      void warn​(java.lang.String message)
      Process a warning message with the underlying logging framework.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SystemLogger

        public SystemLogger​(ResolverConfiguration config)
        Initialize the logger using the default backend.

        The default backend in this case is the one that org.slf4j.LoggerFactory will find for the org.xmlresolver.Resolver class.

        This class doesn't actually use the provided resolver configuration, but it's necessary to support the way loggers are instantiated by the configuration.

        Parameters:
        config - The resolver configuration.
      • SystemLogger

        public SystemLogger​(java.util.logging.Logger log)
        Initialize the logger using an explicit Logger.
        Parameters:
        log - The logger.
    • Method Detail

      • warn

        public void warn​(java.lang.String message)
        Process a warning message with the underlying logging framework.
        Parameters:
        message - The message.
      • info

        public void info​(java.lang.String message)
        Process an informational message with the underlying logging framework.
        Parameters:
        message - The message.
      • debug

        public void debug​(java.lang.String message)
        Process a debug message with the underlying logging framework.
        Parameters:
        message - The message.