Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-526

Add appSetting conversion pattern to PatternString

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.15
    • Fix Version/s: 2.0.6
    • Component/s: Core
    • Labels:
      None

      Description

      A common requirement is to be able to define a base directory for log files that can be used by multiple FileAppenders. In this way, the directory only needs to be changed in one place.

      Today the typical solution is to use a PatternString with a property that is set in code before log4net is configured, e.g.

      <file type="log4net.Util.PatternString" value="%property

      {LogDIr}MyFile.log"/>

      Suggested feature is to allow a conversion pattern that reads the base directory name from an appSetting, e.g.:

      <file type="log4net.Util.PatternString" value="%appSetting{LogDIr}

      MyFile.log"/>

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                JoeJoe Joe
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: