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

Support passing parameters to <include>

    XMLWordPrintable

Details

    Description

      Problem: there is no possibility do include same file multiple times with different context variable values.

      Solution: provide possibility to pass explicit named parameters to included files. Provided parameters should be visible only in included file and should be separated from parent context.

      Example:

      <include resource="file-appender-chain.xml">
          <param name="filePath" value="main.log" />
          <param name="loggerName" value="Main" />
      </include>
      
      <include resource="file-appender-chain.xml">
          <param name="filePath" value="sensitive.log" />
          <param name="loggerName" value="SensitiveData" />
      </include>
      

      Note that here we include same file but with different parameters.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            alexei_osipov Alexei Osipov
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: