Logger
classin packageklyn.logging
public final class Logger:
Logger

Named producer of immutable log events.

Logger instances are cached by LogManager; acquiring a logger is cheap and the object may be retained in a class constant.

Example
import klyn.logging

logger = LogManager.getLogger("myapp")
logger.info("Server started", port = 8080)
Properties
Modifier and Type Member Description
public readonly property debugEnabled
debugEnabled as Boolean:
Whether debug events can reach an active handler.
public readonly property errorEnabled
errorEnabled as Boolean:
Whether error events can reach an active handler.
public readonly property fatalEnabled
fatalEnabled as Boolean:
Whether fatal events can reach an active handler.
public readonly property handlers
handlers as IList<LogHandler>:
Snapshot of the handlers currently configured for this logger.
public readonly property infoEnabled
infoEnabled as Boolean:
Whether informational events can reach an active handler.
public property level
level as LogLevel:
Effective minimum level inherited from the logger hierarchy.
public readonly property name
name as String
Hierarchical logger name.
public readonly property traceEnabled
traceEnabled as Boolean:
Whether trace events can reach an active handler.
public readonly property warningEnabled
warningEnabled as Boolean:
Whether warning events can reach an active handler.
Methods
Modifier and Type Member Description
public debug
debug(message as String, fields ... as String:Object) as Void:
Emits a debug event.
public error
error(message as String, fields ... as String:Object) as Void:
Emits an error event.
public fatal
fatal(message as String, fields ... as String:Object) as Void:
Emits a fatal event.
public info
info(message as String, fields ... as String:Object) as Void:
Emits an informational event.
public log
log(level as LogLevel, message as String, fields ... as String:Object) as Void:
Emits an event at a dynamic level.
public span
span(name as String, fields ... as String:Object) as LogSpan:
Opens a timed span that is automatically logged on close.
public trace
trace(message as String, fields ... as String:Object) as Void:
Emits a trace event.
public warning
warning(message as String, fields ... as String:Object) as Void:
Emits a warning event.