Class 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 Detail

      • getLogger

        public static ILogger getLogger​(@Nonnull
                                        java.lang.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​(@Nonnull
                                        java.lang.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​(java.lang.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.