Java Logging With Abstract Classes

后端 未结 6 1286
闹比i
闹比i 2021-01-30 16:13

I am working on a project, and am currently working on implementing some logging with log4j and I was curious about how I should go about implementing the logs. The two implemen

6条回答
  •  没有蜡笔的小新
    2021-01-30 16:42

    If you create the logger in the abstract class, the logs will all come out tagged as originating from AbstractFoo. If you want/need to see logs tagged with the child class from which the log occurred, create loggers for the children classes.

提交回复
热议问题