<p>Every class that wants to use java.util.logging generally needs to declare a logger like this:</p>

<pre><code>public class MyClass {
    private static Logger _log = Logger.getLogger(MyClass.class.getName());
}
</code></pre>

<p>How do you avoid this MyClass.class.getName() boilerplate code?</p>

You don't need getName() if you're using a 1.2+ version of log4j, getLogger() accepts a Class argument. But as for the rest, there isn't any way around it if you want each class to have a static log member with its own category.