Class CouchbaseLoggerFactory
- java.lang.Object
-
- com.couchbase.client.core.logging.CouchbaseLoggerFactory
-
- Direct Known Subclasses:
CommonsLoggerFactory
,JdkLoggerFactory
,Log4JLoggerFactory
,Slf4JLoggerFactory
public abstract class CouchbaseLoggerFactory extends Object
Creates anCouchbaseLogger
or changes the default factory implementation. This factory allows you to choose what logging framework Netty should use. The default factory isSlf4JLoggerFactory
. If SLF4J is not available,Log4JLoggerFactory
is used. If Log4J is not available,JdkLoggerFactory
is used. You can change it to your preferred logging framework before other SDK classes are loaded:CouchbaseLoggerFactory
.setDefaultFactory(newLog4JLoggerFactory
());setDefaultFactory(CouchbaseLoggerFactory)
should be called as early as possible and shouldn't be called more than once.
-
-
Constructor Summary
Constructors Constructor Description CouchbaseLoggerFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static CouchbaseLoggerFactory
getDefaultFactory()
Returns the default factory.static CouchbaseLogger
getInstance(Class<?> clazz)
Creates a new logger instance with the name of the specified class.static CouchbaseLogger
getInstance(String name)
Creates a new logger instance with the specified name.static RedactionLevel
getRedactionLevel()
Returns the current redaction level.protected abstract CouchbaseLogger
newInstance(String name)
Creates a new logger instance with the specified name.static void
setDefaultFactory(CouchbaseLoggerFactory defaultFactory)
Changes the default factory.static void
setRedactionLevel(RedactionLevel redactionLevel)
Changes the redaction level.
-
-
-
Method Detail
-
getDefaultFactory
public static CouchbaseLoggerFactory getDefaultFactory()
Returns the default factory. The initial default factory isJdkLoggerFactory
.
-
setDefaultFactory
public static void setDefaultFactory(CouchbaseLoggerFactory defaultFactory)
Changes the default factory.
-
getRedactionLevel
public static RedactionLevel getRedactionLevel()
Returns the current redaction level.
-
setRedactionLevel
public static void setRedactionLevel(RedactionLevel redactionLevel)
Changes the redaction level.
-
getInstance
public static CouchbaseLogger getInstance(Class<?> clazz)
Creates a new logger instance with the name of the specified class.
-
getInstance
public static CouchbaseLogger getInstance(String name)
Creates a new logger instance with the specified name.
-
newInstance
protected abstract CouchbaseLogger newInstance(String name)
Creates a new logger instance with the specified name.
-
-