Skip to content

Logging Configuration

Kos uses SLF4J as main logging implementation. Vert.x internal logging is also automatically configured to use SLF4J as its default logging mechanism.

Injecting the logger

Kos allows developers to inject SLF4J Loggers into their components.

import org.slf4j.Logger;

@Singleton
class MyComponent(val logger: Logger) {

}
import org.slf4j.Logger;

@Singleton
class MyComponent {

    Logger logger;

    MyComponent(Logger logger) {
        this.logger = logger;
    }
}