Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-13663

Revisit BeansException warn logging after startup failure

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 3.2.15, 4.1.8, 4.2.2
    • Fix Version/s: 3.2.16, 4.1.9, 4.2.3
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      SPR-12010 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.

        Issue Links

          Activity

          Show
          pwebb Phil Webb added a comment - Pull-request https://github.com/spring-projects/spring-framework/pull/917
          Hide
          pwebb Phil Webb added a comment -

          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 SPR-12010 had a deadlock, for most situations the rethrown exception will be logged eventually.

          Show
          pwebb Phil Webb added a comment - 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 SPR-12010 had a deadlock, for most situations the rethrown exception will be logged eventually.
          Hide
          juergen.hoeller Juergen Hoeller added a comment -

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

          Juergen

          Show
          juergen.hoeller Juergen Hoeller added a comment - No need to wait until 4.2.4 - can easily deal with this for 4.2.3 still Juergen
          Hide
          juergen.hoeller Juergen Hoeller added a comment -

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

          Juergen

          Show
          juergen.hoeller Juergen Hoeller added a comment - Resolved through reducing the warn log entry to a single line with exception type and message but no stacktrace, as discussed on Skype. Juergen
          Hide
          pwebb Phil Webb added a comment -

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

          Show
          pwebb Phil Webb added a comment - Has this been pushed? I don't see any update to the repo.

            People

            • Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              pwebb Phil Webb
              Last updater:
              Juergen Hoeller
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 15 weeks, 4 days ago