Class Logger

java.lang.Object
com.hazelcast.logging.Logger

public final class Logger
extends 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 Details

    • getLogger

      public static ILogger getLogger​(Class clazz)
      Obtains a logger for the given clazz.
      Parameters:
      clazz - the class to obtain the logger for.
      Returns:
      the obtained logger.
    • getLogger

      public static ILogger getLogger​(String name)
      Obtains a logger of the given name.
      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​(String preferredType)
      Creates a logger 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.