Class ExtensionsLogger
java.lang.Object
net.sf.basedb.util.extensions.logging.ExtensionsLogger
A simple logger that services can use to send log message to the BASE
core. An instance is handed out to the service by the
ServiceControllerAction.start()
method, which the service
can use as long as it is running.
Note that the BASE core will automatically send INFO-level messages when the service is started and stopped.
The log is kept in memory only and will not survive server restarts. The number of log entries is also limited. When the limit is reached the oldest entries are automatically removed from the log.
- Since:
- 3.19.8
- Author:
- nicklas
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Log a DEBUG message.void
Log a DEBUG message with an optional stacktrace.void
Log an ERROR message.void
Log an ERROR message with an optional stacktrace.void
Log an INFO message.void
Log an INFO message with an optional stacktrace.boolean
Check if DEBUG logging has been enabled or not.boolean
Check if TRACE logging has been enabled or not.void
Log a message at the specified level.void
Log a message at the specified level with an optional stacktrace.void
Log a TRACE message with the related SLF4J logger.void
Log a TRACE message with an optional stacktrace.void
Log a WARNING message.void
Log a WARNING message with an optional stacktrace.Wrap a generic SLF4J logger with this logger.
-
Field Details
-
log
-
otherLogger
-
-
Constructor Details
-
ExtensionsLogger
ExtensionsLogger(ExtensionsLog log) -
ExtensionsLogger
ExtensionsLogger(ExtensionsLog log, Logger otherLogger)
-
-
Method Details
-
wrap
Wrap a generic SLF4J logger with this logger. Messages that are submitted to the logger created by this method are also forwarded to the SLF4J logger. -
isDebugEnabled
public boolean isDebugEnabled()Check if DEBUG logging has been enabled or not. Debug logging can be enabled either by theExtensionsLog.setDebugEnabled(boolean)
method or by a wrappedLogger
. -
isTraceEnabled
public boolean isTraceEnabled()Check if TRACE logging has been enabled or not. Trace logging is enabled only if both DEBUG logging andExtensionsLog.isCopyingToStdout()
are enabled or if a wrappedLogger
has it enabled. -
log
Log a message at the specified level. -
log
Log a message at the specified level with an optional stacktrace. -
info
Log an INFO message. -
info
Log an INFO message with an optional stacktrace. -
warn
Log a WARNING message. -
warn
Log a WARNING message with an optional stacktrace. -
error
Log an ERROR message. -
error
Log an ERROR message with an optional stacktrace. -
debug
Log a DEBUG message. -
debug
Log a DEBUG message with an optional stacktrace. -
trace
Log a TRACE message with the related SLF4J logger. If no SLF4J logger is related (seewrap(org.slf4j.Logger)
) all TRACE messages will be ignored. -
trace
Log a TRACE message with an optional stacktrace. If no SLF4J logger is related (seewrap(org.slf4j.Logger)
) all TRACE messages will be ignored.
-