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

Add appSetting conversion pattern to PatternString

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.2.15
    • 2.0.6
    • Core
    • 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

              Unassigned Unassigned
              joejoe Joe
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: