1

I have the following log4net appender definition:

  <!-- Setup Rolling Log File to log all information -->
  <appender name="DebugFileAppender" type="log4net.Appender.RollingFileAppender" >
    <file value="${ProgramData}\\WPF Example\\log\\Debug" />
    <appendToFile value="true"/>
    <rollingStyle value="Date"/>
    <datePattern value="_yyyy-MM.\tx\t"/>
    <staticLogFileName value="false"/>
    <lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
    </layout>
  </appender>

I use the same file in a number of projects and would like to have a stock log4net.config file that I do not need to modify per project. In the <file> tag, is there a way to replace the 'WPF Example' with a parameter (similar to '${ProgramData}' ) that would pull the AssemblyTitle from the AssemblyInfo.cs file?

BrianKE
  • 4,035
  • 13
  • 65
  • 115
  • possible duplicate of [Best way to dynamically set an appender file path](http://stackoverflow.com/questions/571876/best-way-to-dynamically-set-an-appender-file-path) – stuartd Sep 07 '14 at 21:27

0 Answers0