com.hazelcast.logging

## 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 Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ILogger` | `getLogger(Class clazz)` Obtains a `logger` for the given `clazz`.
    `static ILogger` | `getLogger(String name)` Obtains a `logger` of the given `name`.
    `static LoggerFactory` | `newLoggerFactory(String preferredType)` Creates a `logger factory` instance of the given preferred type.
    `static ILogger` | `noLogger()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### 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.

Copyright © 2019. All rights reserved.