问题
My Azure web app (App Service) writes a log file mywebapp.log
to the d:\LogFiles directory of the VM that hosts the website. When the log file gets to a certain size I rename it to mywebapp1.log
, mywebapp2.log
, and so on so and a new log file is created. (I do this manually - stop the website, rename the file and restart the site.)
One day I inspected the directory through the Kudu (SCM) portal and saw just a lone mywebapp.log
that was much larger than normal. The file included all of the individual logs that previously existed (included the contents of mywebapp1.log
+ mywebapp2.log
and so on).
My app has no which combines the files. Is there an Azure process that does this or did I do it in my sleep and have no recollection?
回答1:
There really is no logic in Azure that would do this. Azure knows nothing about your log files, and would not be doing anything with them, especially something as complex as combining several existing files into one.
So I'll go with the sleep theory on this one :)
回答2:
The problem was that I had swapped deployment slots at some point and failed to realize that the d:\LogFiles directory (the entire d: drive I believe) travels with the slot. The missing log files were sitting in my staging slot's LogFiles directory.
来源:https://stackoverflow.com/questions/32915520/custom-logs-in-azure-website-file-system-combined-into-single-log-file