Package com.couchbase.client.core.cnc
Class LoggingEventConsumer
- java.lang.Object
-
- com.couchbase.client.core.cnc.LoggingEventConsumer
-
public class LoggingEventConsumer extends Object implements Consumer<Event>
ConsumesEvents
and logs them per configuration.This consumer is intended to be attached per default and performs convenient logging throughout the system. It tries to detect settings and loggers in a best-effort way but can always be swapped out or changed to implement custom functionality.
If SLF4J is detected on the classpath it will be used, otherwise it will fall back to java.com.couchbase.client.test.util.logging or the console depending on the configuration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
LoggingEventConsumer.Logger
Generic logger interface.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(Event event)
static LoggingEventConsumer
create()
Creates a newLoggingEventConsumer
with all defaults.static LoggingEventConsumer
create(LoggerConfig loggerConfig)
-
-
-
Method Detail
-
create
public static LoggingEventConsumer create()
Creates a newLoggingEventConsumer
with all defaults.- Returns:
- a
LoggingEventConsumer
.
-
create
public static LoggingEventConsumer create(LoggerConfig loggerConfig)
-
-