Installing Umbraco v9 on Azure: change log file location
Dears,
we are installing Umbraco v9 to azure using az webapp deploy (which uses the Kudu zip deploy API endpoint underneath).
We setup the config as recommended for azure, with the EnvironmentTemp setting, and that takes care of everything that is under Data/Temp.
But every time we deploy a new version, the Log folder gets deleted.
Is it possible to change the location of log files, or write to a storage account or exclude them from the "cleanup" of the current folder during deployment?
You can install the Serilog.Sinks.AzureBlobStorage nuget package and configure a second serilog sync to log to blob storage. However, the logs that are put there can't be viewed by the Umbraco back office, but it does work as a good secondary source of logs.
Once you've installed the nuget package, there are a few settings needed in the appsettings.json to get it to work, but it's pretty quick to setup.
This means that your Umbraco back office will show you the logs for your currently deployed site, but if you need historic you need to download the logs from blob storage and then use something like Compact log viewer to view them locally.
All our websites in azure are loadbalanced, so that might be a different setup as you are using. But we often log to a sql server or other storage by using a different Serilog sink.
Installing Umbraco v9 on Azure: change log file location
Dears, we are installing Umbraco v9 to azure using az webapp deploy (which uses the Kudu zip deploy API endpoint underneath). We setup the config as recommended for azure, with the EnvironmentTemp setting, and that takes care of everything that is under Data/Temp.
But every time we deploy a new version, the Log folder gets deleted.
Is it possible to change the location of log files, or write to a storage account or exclude them from the "cleanup" of the current folder during deployment?
Hey Simone,
You can install the
Serilog.Sinks.AzureBlobStorage
nuget package and configure a second serilog sync to log to blob storage. However, the logs that are put there can't be viewed by the Umbraco back office, but it does work as a good secondary source of logs.Once you've installed the nuget package, there are a few settings needed in the appsettings.json to get it to work, but it's pretty quick to setup.
This means that your Umbraco back office will show you the logs for your currently deployed site, but if you need historic you need to download the logs from blob storage and then use something like
Compact log viewer
to view them locally.Thanks
Nik
Hi Simone,
All our websites in azure are loadbalanced, so that might be a different setup as you are using. But we often log to a sql server or other storage by using a different Serilog sink.
But depending on what you are using you will need to create a custom logviewer implementation. See the docs about that : https://our.umbraco.com/Documentation/Fundamentals/Backoffice/LogViewer/#create-your-own-implementation
Dave
Thanks Dave.
We do have loadbalancing as well... this solution looks perfect!
is working on a reply...