I am refactoring a legacy application where the actual application is scattered in between lot of logging statements. I could immediately benefit by removing TRACE level logging (method entered/exited). However this has proven to be useful many times while debugging an app while integration testing etc. So I am wondering if there is already a working and proven (being used for a while) aspect written for this? I've gone though some online posts but they seem to simple enough (and not sure if they have ever been really used) to be used for real project.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Checkout aspects from "AspectJ in Action" (sources can be downloaded from http://manning.com/laddad2). I have used very close variations of aspects from chapter 10 on real projects.
You can use
@Loggable
annotation from jcabi-aspects, together with a built-in AspectJ aspect:It logs through SLF4J, which you can redirect to your own logging facility like, say, log4j.