How to enable FINE logging for a single java class

前端 未结 5 1220
温柔的废话
温柔的废话 2021-01-21 06:13

I\'m using java.util.logging.Logger logging in my program. How do I enable FINE logging for a single class, while setting it to WARNING for every othe

5条回答
  •  孤街浪徒
    2021-01-21 06:36

    If you do not want to have a logger defined for every single class in question but rather want to share loggers between classes, you can alternatively implement your own java.util.logging.Handler that has its own way of filtering for class names using the information provided by LogRecord.getSourceClassName().

提交回复
热议问题