I use the following code snippet to create an slf4j Logger object
private static final Logger LOGGER = LoggerFactory.getLogger(MyClass.class);
and copy it to a new class when I'm working on it, but from time to time I'll forget to change the class name, and create a Logger object for MyClass in a class called YourClass, which leads to confusing statements in the logs.
I know the recommendation for getting the name of a class is to use MyClass.class.getName(), but is there a generic snippet I can use to instantiate a Logger that can be copied to new classes without needing any changes?