vertx / io.vertx.core.logging / Logger

Logger

open class Logger

This class allows us to isolate all our logging dependencies in one place. It also allows us to have zero runtime 3rd party logging jar dependencies, since we default to JUL by default.

By default logging will occur using JUL (Java-Util-Logging). The logging configuration file (logging.properties) used by JUL will taken from the default logging.properties in the JDK installation if no java.util.logging.config.file system property is set.

If you would prefer to use Log4J or SLF4J instead of JUL then you can set a system property called vertx.logger-delegate-factory-class-name to the class name of the delegate for your logging system. For Log4J the value is io.vertx.core.logging.Log4jLogDelegateFactory, for SLF4J the value is io.vertx.core.logging.SLF4JLogDelegateFactory. You will need to ensure whatever jar files required by your favourite log framework are on your classpath.

Keep in mind that logging backends use different formats to represent replaceable tokens in parameterized messages. As a consequence, if you rely on parameterized logging methods, you won't be able to switch backends without changing your code.

Author
Tim Fox

Constructors

<init>

Logger(delegate: LogDelegate)

Functions

debug

open fun debug(message: Any): Unit
open fun debug(message: Any, t: Throwable): Unitopen fun debug(message: Any, vararg objects: Any): Unit
open fun debug(message: Any, t: Throwable, vararg objects: Any): Unit

error

open fun error(message: Any): Unit
open fun error(message: Any, t: Throwable): Unitopen fun error(message: Any, vararg objects: Any): Unit
open fun error(message: Any, t: Throwable, vararg objects: Any): Unit

fatal

open fun fatal(message: Any): Unit
open fun fatal(message: Any, t: Throwable): Unit

getDelegate

open fun getDelegate(): LogDelegate

info

open fun info(message: Any): Unit
open fun info(message: Any, t: Throwable): Unitopen fun info(message: Any, vararg objects: Any): Unit
open fun info(message: Any, t: Throwable, vararg objects: Any): Unit

isDebugEnabled

open fun isDebugEnabled(): Boolean

isInfoEnabled

open fun isInfoEnabled(): Boolean

isTraceEnabled

open fun isTraceEnabled(): Boolean

trace

open fun trace(message: Any): Unit
open fun trace(message: Any, t: Throwable): Unitopen fun trace(message: Any, vararg objects: Any): Unit
open fun trace(message: Any, t: Throwable, vararg objects: Any): Unit

warn

open fun warn(message: Any): Unit
open fun warn(message: Any, t: Throwable): Unitopen fun warn(message: Any, vararg objects: Any): Unit
open fun warn(message: Any, t: Throwable, vararg objects: Any): Unit