Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-645

ContextInitializer.configureByResource(URL url) should properly indicate whether configuration succeeded or not

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 0.9.30
    • logback-classic
    • None

    Description

      Scenario:

      • I have a list of resources to be tried in turn for configuration with "first one wins"
      • Having built the URL, I call "configureByResource(URL url)"

      Problem: I do not know whether this resulted in successful configuration.

      -> Case of a resource ending not ending in "xml" or "groovy" ---> Return without error but with any configuration
      -> Case of a resource ending in "xml" and successful configuration ---> Return without error and successful configuration (and registered as "safe configuration", too)
      -> Case of a resource ending in "xml" and XML errors ---> Return without error and no config change
      -> Case of a resource ending in "xml" and I/O exception ---> Return with raised JoranException
      -> Case of a resource ending in "groovy" and no Groovy ---> Return without error and no config change
      -> Case of a resource ending in "groovy" and Groovy errors ---> Unsure whether GafferUtil.runGafferConfiguratorOn() can throw Runtime Exceptions from Groovy
      -> Case of a resource ending in "groovy" and no Groovy errors ---> Return without error and successful configuration

      This should be made clearer as far as possible:

      --> One "ConfigurationException" if there was a problem, with the "cause" telling what
      --> Normal return with "true" --> Configuration successfully changed
      --> Normal return with "false" --> Configuration was not changed (i.e. a NOP)

      Attachments

        Activity

          People

            logback-dev Logback dev list
            dtonhofer David Tonhofer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: