Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CustomizableTraceInterceptor should allow INVOCATION_TIME placeholder in setExceptionMessage and make stack trace logging configurable [SPR-15763] #20318

Closed
spring-issuemaster opened this issue Jul 12, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

commented Jul 12, 2017

Jonathan Baker opened SPR-15763 and commented

At one time, the CustomizableTraceInterceptor did not correctly calculate method invocation time when an exception was thrown. That issue was fixed with #6468.

However, the setExceptionMessage() method still throws an exception if the INVOCATION_TIME placeholder is used. This extra check simply needs removed.


Affects: 4.3.9

Issue Links:

  • #6468 Make invocationTime meaningful in exceptionMessage in CustomizableTraceInterceptor

Referenced from: pull request #1475, and commits 6d7612e, aa0d7a6, 50f8b6b, 19a8efc

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 12, 2017

Juergen Hoeller commented

Good point, and I've taken the opportunity to do a slightly broader revision of CustomizableTraceInterceptor and its assertion messages. To be backported to 4.3.10.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 13, 2017

Jonathan Baker commented

What do you think about making the logging of the stack trace configurable? It is an easy enough fix, just call logger.trace(message) instead of logger.trace(message, exception)

In our case we enable the interceptor in production on all methods annotated with @Timed (from dropwizard). For successful method calls this works great and gives us great parseable log events. However in the case of an exception, the stack trace is repeatedly logged as the exception propogates up the call stack.

It would be nice to be able to disable stack trace logging from the interceptor.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 13, 2017

Juergen Hoeller commented

Good point! As a further part of this ticket, I've added a corresponding logExceptionStackTrace flag to AbstractTraceInterceptor, and moved the writeToLog delegate methods from CustomizableTraceInterceptor up to the base class, taking that flag into account now.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 13, 2017

Jonathan Baker commented

Great. Thank you again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.