You can shorthand this a tiny bit, as getLogger is overloaded to also just take the class. Like so:
public class MyClass {
private static Logger _log = Logger.getLogger(MyClass.class);
}
The Logger can be as fleixble or inflexible as you want it to be. You can grab a new logger for each class, as in your example above, and have a hierarchy of loggers where you can controll and turn on/off the logging by class. Or if your project is small or a prototype, etc, you could just call Logger.getRootLogger() - but you'll lose the flexibility of fine-tuning what you log and don't log. You could have a base class where the logger lives, and have everyone call that one, but again, you lose some flexibility:
public class MyBase {
protected static Logger _log = Logger.getLogger(MyClass.class);
}
public class MyClass extends MyBase {
....
_log.info("Stuff....");
}
Bottom line, if you want to keep the ability to fine-tune configure your logging later in the project (turn on finer level debugging for just one class), then you may have to stick with the boilerplate in every class.