How to automatically log the entry/exit of methods in Java?

前端 未结 5 1961
庸人自扰
庸人自扰 2020-12-02 17:37

Right now I am using java.util.logging to log the entry and exit points of each method in my Java project. This is very useful to me when debugging.

I h

5条回答
  •  [愿得一人]
    2020-12-02 18:02

    You should look at Aspect oriented programming. I would suggest Spring AOP or AspectJ as something that you should look at.

    Also, here's a quick tutorial to help you get started with Logging with Spring AOP

提交回复
热议问题