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

Revisit BeansException warn logging after startup failure [SPR-13663] #18238

Closed
spring-issuemaster opened this Issue Nov 10, 2015 · 5 comments

Comments

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

spring-issuemaster commented Nov 10, 2015

Phil Webb opened SPR-13663 and commented

#16626 added warn logging to AbstractApplicationContext to ensure that BeansExceptions don't get missed.

Although the intention is good, it has the unwanted side effect of causing most refresh failures to log stacktraces twice. This is particularly obvious with Spring Boot applications where a simple startup failure results in multiple stack-traces.

We could provide a feature flag to suppress the message.


Affects: 3.2.15, 4.1.8, 4.2.2

Issue Links:

  • #16626 Exceptions thrown during AbstractApplicationContext.refresh() not being logged right when they are caught
  • #22081 Do not swallow exception cause when context refresh fails

Referenced from: commits 03585f2, 5d6aab3, cdf6eb9

Backported to: 4.1.9, 3.2.16

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Nov 10, 2015

Phil Webb commented

Pull-request #917

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Nov 10, 2015

Phil Webb commented

I'm in two minds about the feature flag. We could probably argue that warn logging is overkill and simply downgrade it to debug. The message was only added because the original reporter of #16626 had a deadlock, for most situations the rethrown exception will be logged eventually.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Nov 10, 2015

Juergen Hoeller commented

No need to wait until 4.2.4 - can easily deal with this for 4.2.3 still :-)

Juergen

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Nov 10, 2015

Juergen Hoeller commented

Resolved through reducing the warn log entry to a single line with exception type and message but no stacktrace, as discussed on Skype.

Juergen

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

spring-issuemaster commented Nov 10, 2015

Phil Webb commented

Has this been pushed? I don't see any update to the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment