We've 3 separate deployments:
- Azure App Service (Web API application) w/ no web-jobs
- Azure Dummy Web Site w/ 1 Web Job
- Azure Dummy Web site w/ 1 Web Job
We will update them from time-to-time; publishing to a Staging Deployment-Slot and then swapping the Staging slot to Production once we're comfortable w/ what was deployed. We sometimes do this for all 3 at the same time, and sometimes only 1 at a time.
The applications use NLog
to to log interesting things (at DEBUG
, INFO
, etc.). We've configured xsi:type="File"
targets that write to the local drive (which I realize is blob-backed and shared across all instances). We currently write to a location under %HOME%\site\wwwroot
.
Problem with our approach is the log-files are bound to the particular Slot we happen to be running in.
So when we log in Production for a month, deploy to a Staging slot, then swap it to Production ... we wipe out the month's worth of NLog
application logs. Actually it gets swapped over to Staging and we'd have to do some manually copying/moving to merge it with the new Production application log.
I am pretty sure we're missing something simple and we're doing this wrong, or the hard-way.
What is a way that we can "log" to one place assigned to "Production" and have that log data contain, in only one place, all the data logged by our application over multiple deployments to Production.