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

ReconfigureOnChangeFilter should re-use substition properties from initial configuration

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 0.9.27
    • logback-classic
    • None

    Description

      Logback configuration files are automatically reloaded when scan="true" is set. This is implemented using ReconfigureOnChangeFilter. The actually re-configuration happens in ReconfiguringThread which always creates a new default JoranConfigurator.

      This is works as long as the initial JoranConfigurator hasn't been extended to support additional substitution properties.

      // create our customized configurator
      final JoranConfigurator configurator = new JoranConfigurator() {
         @Override
         protected void addImplicitRules(final Interpreter interpreter) {
            super.addImplicitRules(interpreter);
            // set some properties for log file substitution
            if (null != instanceLogfileDirectory) {
               interpreter.getInterpretationContext().addSubstitutionProperty("my.property", calculateMyPropertyValue());
            }
         }
      };
      

      It should somehow be possible to inherit the custom substitution properties into the new JoranConfigurator. Otherwise they are lost on re-configuration.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            gunnar Gunnar Wagenknecht
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: