Class SystemLogger
- All Implemented Interfaces:
ResolverLogger
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.
-
Field Summary
Fields inherited from class org.xmlresolver.logging.AbstractLogger
CACHE, catalogLogging, categories, CONFIG, DEBUG, ERROR, INFO, NONE, REQUEST, RESPONSE, TRACE, WARN, WARNING
-
Constructor Summary
ConstructorsConstructorDescriptionSystemLogger
(Logger log) Initialize the logger using an explicitLogger
.SystemLogger
(ResolverConfiguration config) Initialize the logger using the default backend. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Process a debug message with the underlying logging framework.void
Process an informational message with the underlying logging framework.void
Process a warning message with the underlying logging framework.Methods inherited from class org.xmlresolver.logging.AbstractLogger
getCategory, log, logMessage, setCategory
-
Constructor Details
-
SystemLogger
Initialize the logger using the default backend.The default backend in this case is the one that
org.slf4j.LoggerFactory
will find for theorg.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
Initialize the logger using an explicitLogger
.- Parameters:
log
- The logger.
-
-
Method Details
-
warn
Process a warning message with the underlying logging framework.- Parameters:
message
- The message.
-
info
Process an informational message with the underlying logging framework.- Parameters:
message
- The message.
-
debug
Process a debug message with the underlying logging framework.- Parameters:
message
- The message.
-