@Retention(value=SOURCE) @Target(value=TYPE) public @interface CustomLog
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.
| Modifier and Type | Optional Element and Description |
|---|---|
AccessLevel |
access
Sets the access level of the generated log field.
|
String |
topic
Sets a custom topic/category.
|
public abstract AccessLevel access
AccessLevel.PRIVATE.public abstract String topic
TOPIC.TOPIC is invoked.Copyright © 2025. All rights reserved.