Package com.hazelcast.logging
Class Logger
- java.lang.Object
-
- com.hazelcast.logging.Logger
-
public final class Logger extends java.lang.Object
Provides static utilities to access the global shared logging machinery.Note: if possible, avoid logging in the global shared context exposed by the utilities of this class, use
LoggingService
instead.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ILogger
getLogger(java.lang.Class clazz)
Obtains alogger
for the givenclazz
.static ILogger
getLogger(java.lang.String name)
Obtains alogger
of the givenname
.static LoggerFactory
newLoggerFactory(java.lang.String preferredType)
Creates alogger factory
instance of the given preferred type.static ILogger
noLogger()
-
-
-
Method Detail
-
getLogger
public static ILogger getLogger(@Nonnull java.lang.Class clazz)
Obtains alogger
for the givenclazz
.- Parameters:
clazz
- the class to obtain the logger for.- Returns:
- the obtained logger.
-
getLogger
public static ILogger getLogger(@Nonnull java.lang.String name)
Obtains alogger
of the givenname
.- Parameters:
name
- the name of the logger to obtain.- Returns:
- the obtained logger.
-
noLogger
public static ILogger noLogger()
- Returns:
- the no operation logger, which ignores all logging requests.
-
newLoggerFactory
public static LoggerFactory newLoggerFactory(java.lang.String preferredType)
Creates alogger factory
instance of the given preferred type.The type of the created logger factory doesn't necessarily match the given preferred type. For example, if
hazelcast.logging.class
system property is set, the configured logger factory class will be used despite the given preferred type. Also, if factory instance construction is failed for some reason,StandardLoggerFactory
instance will be returned instead.- Parameters:
preferredType
- the preferred type of the logger factory to create.- Returns:
- the created logger factory.
-
-