Open craigwilliams84 opened 9 years ago
Are we going to allow user to configure Advices ?
i.e
After throwing advice: Advice to be executed if a method exits by throwing an exception. After (finally) advice: Advice to be executed regardless of the means by which a join point exits (normal or exceptional return).
I'm not sure we would need to allow users to configure advices directly as we're only concerned with logging entry and exit from methods. I do think it would be useful to allow a different message to be displayed when an exception is thrown though and this does seem to be supported within the CustomizableTraceInterceptor that we use (which i believe uses an Around advice under the covers).
I guess that was what I was trying to say - should we allow user to log something other than straight entry and exit ?
We should definitely do the throwing case that you described but the finally advice will be more difficult to implement as the CustomizableTraceInterceptor doesn't support this (as far as I know), and I'm not sure it adds enough in the way of functionality to make it worthwhile. What are peoples thoughts?
I think if we're going to do finally
then the right way is to add the capability to CustomizableTraceInterceptor
first. There may even already by an issue.
Currently the log messages for entering and exiting methods are fixed, but we should add the ability to specify the messages via properties.
After comments from @sirsir, we should also allow a different message to be configured when a traced method throws an exception.