Replacing variables in log4net.config

Hi!
Im wondering if its possible to replace variables in a log4net.config file with values that exists in the Octopus Variable list?

The file has the following structure, and what Im interested in is to replace the value in the </ connectionString> tag:

<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
    <bufferSize value="1" />
    <connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <connectionString value="Data Source=(LocalDb)\MSSQLLocalDB;Database=SomeDB; Integrated Security=True" />
    <commandText value="INSERT INTO Log ([Stamp],[Message],[LogType],[Caller],[Exception]) VALUES (@log_date, @message, @log_level, @logger, @exception)" />
    <parameter>
      <parameterName value="@log_date" />
      <dbType value="DateTime" />
      <layout type="log4net.Layout.RawTimeStampLayout" />
    </parameter>
    <parameter>
      <parameterName value="@message" />
      <dbType value="String" />
      <size value="4000" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%message" />
      </layout>
    </parameter>
    <parameter>
      <parameterName value="@log_level" />
      <dbType value="String" />
      <size value="50" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%level" />
      </layout>
    </parameter>
    <parameter>
      <parameterName value="@logger" />
      <dbType value="String" />
      <size value="255" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%logger" />
      </layout>
    </parameter>
    <parameter>
      <parameterName value="@exception" />
      <dbType value="String" />
      <size value="2000" />
      <layout type="log4net.Layout.ExceptionLayout" />
    </parameter>
  </appender>
  <root>
    <level value="DEBUG"/>
    <appender-ref ref="FileAppender"/>
    <appender-ref ref="AdoNetAppender"/>
  </root>
</log4net>

It is possible, i’ve just been through the exact same process.

You have to use the Configure Features -> Substitute variables in files feature within your deployment step

Add the log.config to the target files and your variable substitutions will be done

Another wrinkle is that you can do the same with config transforms, sine the variable substitution is done before the transformation step

so I have two lines in my Additional transforms section

log.Release.config => log.config
Web.Release.config => Web.config

and my target files has:

log.Release.config
Web.Release.config

Variable substitution looks like this in the log.Release.config

  <connectionString value="data source=#{ConfigDatabaseServer};initial catalog=#{LoggingDatabaseCatalog};User ID=#{LoggingDatabaseUser};Password=#{LoggingDatabasePassword};integrated security=false;persist security info=True;" xdt:Transform="Replace"/>