I'm using Octopus as part of our deployment for a .NET Core 3.1 Web API project.
log4net.config exists in .\Utility\Logs.
I'm trying to follow the pattern here: https://help.octopus.com/t/transformation-best-practice-log4net-config-or-any-non-web-app-config/9906/4
As I understand it, this consists of three parts:
Create
Log4Net.DeploymentTransform.config, with the variables in#{name}format - this has been done.Turn on the "Substitute variables in files" feature, and point at the
Log4Net.DeploymentTransform.configtransformation file (variable replacement happens before transformation). That would result in the#{LogFileLocation}variable being replaced with whatever value was set for yourLogFileLocationvariable in the current scope.This is done and is working.when my app is deployed,
Log4Net.DeploymentTransform.configis there as well and the variable has been successfully set in it.You'd also turn on the configuration transforms feature, and fill out the additional transforms section in the configuration transforms feature to identify your transform file (e.g.
Log4Net.DeploymentTransform.config=>log4net.config).This is not working, the content of
Log4Net.DeploymentTransform.configis not being copied on top oflog4net.config, though they are in the same folder upon deployment.
Here is what I did in our "deploy step"
Which sure looks like what the article is saying to do.
What else should I check? Any idea why step 3 isn't occurring?

Your syntax looks correct for the files - have you checked to ensure that you have the xdt attributes set?
In the example forum post you shared, the
log4netandappenderelements are tagged withxmlns:xdt,xdt:Transformandxdt:Matchattributes that help the XDT layer determine how to transform the files.A quick example - I created a
Log4NetConfigTestpackage with two files -Utility/Logs/log4net.configUtility/Logs/log4net.trasnform.configI used the same sample code from the forum post as well.
Here's the set up for my package deployment configurations:
With that set up (and my
LogFileLocationproject variable set), I was able to see the following in my task log for the deployment:The task log confirmed that Octopus did apply the transformations, and once deployed, I confirmed that my new test log location was present and correct in both the base configuration and the transformation file.