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
Logger(delegate: LogDelegate) |
open fun debug(message: Any): Unitopen fun debug(message: Any, t: Throwable): Unitopen fun debug(message: Any, vararg objects: Any): Unitopen fun debug(message: Any, t: Throwable, vararg objects: Any): Unit |
|
open fun error(message: Any): Unitopen fun error(message: Any, t: Throwable): Unitopen fun error(message: Any, vararg objects: Any): Unitopen fun error(message: Any, t: Throwable, vararg objects: Any): Unit |
|
open fun fatal(message: Any): Unitopen fun fatal(message: Any, t: Throwable): Unit |
|
open fun getDelegate(): LogDelegate |
|
open fun info(message: Any): Unitopen fun info(message: Any, t: Throwable): Unitopen fun info(message: Any, vararg objects: Any): Unitopen fun info(message: Any, t: Throwable, vararg objects: Any): Unit |
|
open fun isDebugEnabled(): Boolean |
|
open fun isInfoEnabled(): Boolean |
|
open fun isTraceEnabled(): Boolean |
|
open fun trace(message: Any): Unitopen fun trace(message: Any, t: Throwable): Unitopen fun trace(message: Any, vararg objects: Any): Unitopen fun trace(message: Any, t: Throwable, vararg objects: Any): Unit |
|
open fun warn(message: Any): Unitopen fun warn(message: Any, t: Throwable): Unitopen fun warn(message: Any, vararg objects: Any): Unitopen fun warn(message: Any, t: Throwable, vararg objects: Any): Unit |