Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Nice solution if you only need getSimpleName() call to print help from main method. Commented Jun 6, 2017 at 6:44
  • 11
    I was looking for a 'copy paste' solution for adding logger every where, without changing the class name each time. You gave it to me : private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); Commented Oct 22, 2018 at 10:01
  • The best solution where it’s supported, drawback being that Android does not support this until API 26, i.e. Android 8. Commented May 20, 2020 at 19:48