Package lombok

Annotation Type CustomLog


@Retention(SOURCE) @Target(TYPE) public @interface CustomLog
Causes lombok to generate a logger field based on a custom logger implementation.

Complete documentation is found at the project lombok features page for lombok log annotations.

Example:

 @CustomLog
 public class LogExample {
 }
 
With configuration:
 lombok.log.custom.declaration=my.cool.Logger my.cool.LoggerFactory.getLogger(NAME)
 
will generate:
 public class LogExample {
     private static final my.cool.Logger log = my.cool.LoggerFactory.getLogger(LogExample.class.getName());
 }
 

Configuration must be provided in lombok.config, otherwise any usage of this annotation will result in a compile-time error. This annotation is valid for classes and enumerations.

See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Sets a custom topic/category.
  • Element Details

    • topic

      String topic
      Sets a custom topic/category. Note that this requires you to specify a parameter configuration for your custom logger that includes TOPIC.
      Returns:
      The topic/category of the constructed Logger. By default (or for the empty string as topic), the parameter configuration without TOPIC is invoked.
      Default:
      ""