vertx / io.vertx.core.logging

Package io.vertx.core.logging

Types

JULLogDelegate

open class JULLogDelegate : LogDelegate

A io.vertx.core.spi.logging.LogDelegate which delegates to java.util.logging

JULLogDelegateFactory

open class JULLogDelegateFactory : LogDelegateFactory

A io.vertx.core.spi.logging.LogDelegateFactory which creates JULLogDelegate instances.

Log4j2LogDelegate

open class Log4j2LogDelegate : LogDelegate

A LogDelegate which delegates to Apache Log4j 2

Log4j2LogDelegateFactory

open class Log4j2LogDelegateFactory : LogDelegateFactory

A LogDelegateFactory which creates Log4j2LogDelegate instances.

Log4jLogDelegate

open class Log4jLogDelegate : LogDelegate

A io.vertx.core.spi.logging.LogDelegate which delegates to Apache Log4j

Log4jLogDelegateFactory

open class Log4jLogDelegateFactory : LogDelegateFactory

A io.vertx.core.spi.logging.LogDelegateFactory which creates Log4jLogDelegate instances.

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.

LoggerFactory

open class LoggerFactory

SLF4JLogDelegate

open class SLF4JLogDelegate : LogDelegate

SLF4JLogDelegateFactory

open class SLF4JLogDelegateFactory : LogDelegateFactory

VertxLoggerFormatter

open class VertxLoggerFormatter : Formatter