I've found a lot of examples on how to create a custom aspect for logging using the Spring framework like this or this but did not find standard/common Spring implementation for this situation and question. Are there any standard implementations of logging aspect from Spring or not?
相关问题
- 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
Here are the list of frameworks that do logging via AOP:
http://aspect4log.sf.net - does very nice looking logging via slf4j and @Log annotation. Can work via SpringAOP, and AspectJ. With AspectJ it works even for private methods and constructors and does not require a class to be a Spring Bean. Very easy to use, i was able to make it running with my project within 5 min.
http://loggifier.unkrig.de - does logging via java.util.logging, a bit too complex and not that well document but claims that it can instrument already compiled jar/war/ear files!
AbstractTraceInterceptor (from SpringAOP) and it's subclasses SimpleTraceInterceptor and CustomizableTraceInterceptor. Logging configuration is done separately from classes. Logs via commons-logging. Since it is designed for SpringAOP you have to work with Spring Beans (and only with Spring Beans public methods).
Yes there are!
Check out the CustomizableTraceInterceptor API, you can define separate enter/exit/exception messages with several placeholders: