org.apache.ignite.resources

## Annotation Type LoggerResource

-     @Documented
       @Retention(value=RUNTIME)
       @Target(value={METHOD,FIELD})
      public @interface LoggerResource

  Annotates a field or a setter method for injection of `IgniteLogger`. Grid logger is provided to grid via `IgniteConfiguration`.

  Logger can be injected into instances of following classes:

  - `ComputeTask`
  - `ComputeJob`
  - `IgniteSpi`
  - `LifecycleBean`

  Here is how injection would typically happen:

       public class MyGridJob implements ComputeJob {
            ...
            @LoggerResource
            private IgniteLogger log;
            ...
        }

  or

       public class MyGridJob implements ComputeJob {
           ...
           private Ignite log;
           ...
           @LoggerResource
           public void setGridLogger(IgniteLogger log) {
                this.log = log;
           }
           ...
       }

  See `IgniteConfiguration.getGridLogger()` for Grid configuration details.

- - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `Class` | `categoryClass` Optional log category class.
    `String` | `categoryName` Optional log category name.

- - ### Element Detail

    - #### categoryClass

          public abstract Class categoryClass

      Optional log category class. If not provided (i.e. by default `Void` class is returned), then the category will be the class into which resource is assigned.

      Either `categoryClass` or `categoryName()` can be provided, by not both.

      Returns:
        Category class of the injected logger.
      Default:
        java.lang.Void.class

  - - #### categoryName

          public abstract String categoryName

      Optional log category name. If not provided, then `categoryClass()` value will be used.

      Either `categoryName` or `categoryClass()` can be provided, by not both.

      Returns:
        Category name for the injected logger.
      Default:
        ""

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.1
Release Date | : December 9 2020