Hi,
I am trying to move the Umbraco log files to Azure storage account. I have install package Serilog.Sinks.AzureBlobStorage and updated the serilog.user.config with the following appSettings:
I can see the logs being generated in the correct storage account and container, but the site does not load... the page is waiting for loading.
I've tried, moving the appSetting to serilog.config commenting out the default Json log file and still getting the same issue. Has anyone else experience the same issue? BTW I am running the site locally on my machine with IIS. Also run the site in debug mode IIS Express, able to replicate the same issue.
If I remove the above appSettings, the site loads without any issue. So not sure what I am missing that might cause this issue. Any help would be much apricated.
I'm attempting to get this set up in the exact same way you have and getting the same timeout issues. I can see the log file on the blob container, but errors.
You must be a mind reader as I was actually in the middle of sorting it as I received your reply.
I'm happy to say that within the past few minutes that I've got this sorted. Instead of using Azure Blob Storage, use Azure Table Storage instead, it's far easier to work with and I guess there might be some performance gains via this method.
I made another small alteration of my own by moving the configuration out of the serilog.config/serilog.user.config and just having them in the appSettings of the web.config and doing the following to avoid having the connection string hard coded:
var appSetting = ConfigurationManager.AppSettings["serilog:write-to:AzureTableStorage.connectionString"];
var cloudStorage = CloudStorageAccount.Parse(appSetting);
And here's what it'll look like within Azure Storage Explorer:
@andy how did u move the serialog.user.config setting to webconfig ?
I made another small alteration of my own by moving the configuration out of the serilog.config/serilog.user.config and just having them in the appSettings of the web.config and doing the following to avoid having the connection string hard coded:
You can in the class , for the log viewer , but the settings in the seriallog.config , will still have the connection string ?
Sorry I thought I had posted an update to this thread with an update following an observation I made following a deployment to a live server.
When I say I moved the configuration out of the serilog.config/serilog.user.config to the web.config, I mean I literally copied & pasted the settings.
HOWEVER, by doing that it will not create the Azure Table upon needing to set up logging in another environment / new Azure account.
It would still be worth keeping the connection string app setting in the web.config rather than having to hard code it into your compiled code. Yeah it's duplication of settings, but I haven't yet found a method of consolidating the setting into one place where Serilog can find the right config, and the LogViewer code can also find the same setting.
@andy , finally figure out how to get this to work in multi env . We have a prod / test / dev , in azure so using the azure server variables works well . when moving from env to env .
Move Umbraco log to Azure storage account
Hi, I am trying to move the Umbraco log files to Azure storage account. I have install package Serilog.Sinks.AzureBlobStorage and updated the serilog.user.config with the following appSettings:
I can see the logs being generated in the correct storage account and container, but the site does not load... the page is waiting for loading.
I've tried, moving the appSetting to serilog.config commenting out the default Json log file and still getting the same issue. Has anyone else experience the same issue? BTW I am running the site locally on my machine with IIS. Also run the site in debug mode IIS Express, able to replicate the same issue.
If I remove the above appSettings, the site loads without any issue. So not sure what I am missing that might cause this issue. Any help would be much apricated.
Hi,
Did you ever find out what the issue was?
I'm attempting to get this set up in the exact same way you have and getting the same timeout issues. I can see the log file on the blob container, but errors.
Thanks,
Andy
Hi Andy,
Apologies for the delay in responding. Unfortunately I was not able to resolve the issue.
Hey Abdul,
You must be a mind reader as I was actually in the middle of sorting it as I received your reply.
I'm happy to say that within the past few minutes that I've got this sorted. Instead of using Azure Blob Storage, use Azure Table Storage instead, it's far easier to work with and I guess there might be some performance gains via this method.
Here's a forum post which helped me: https://our.umbraco.com/forum/umbraco-8/97245-umbraco-8-serilog-and-serilog-sinks#comment-321674 I think the author followed Umbraco's own documentation and slightly adapted it: https://our.umbraco.com/documentation/Fundamentals/Backoffice/LogViewer/
I made another small alteration of my own by moving the configuration out of the serilog.config/serilog.user.config and just having them in the appSettings of the web.config and doing the following to avoid having the connection string hard coded:
And here's what it'll look like within Azure Storage Explorer:
All the best,
Andy
Thanks for all thr reply, I finally got it working with Azure log analytics workspace.
@andy how did u move the serialog.user.config setting to webconfig ? I made another small alteration of my own by moving the configuration out of the serilog.config/serilog.user.config and just having them in the appSettings of the web.config and doing the following to avoid having the connection string hard coded:
You can in the class , for the log viewer , but the settings in the seriallog.config , will still have the connection string ?
Andy
Sorry I thought I had posted an update to this thread with an update following an observation I made following a deployment to a live server.
When I say I moved the configuration out of the serilog.config/serilog.user.config to the web.config, I mean I literally copied & pasted the settings.
HOWEVER, by doing that it will not create the Azure Table upon needing to set up logging in another environment / new Azure account.
It would still be worth keeping the connection string app setting in the web.config rather than having to hard code it into your compiled code. Yeah it's duplication of settings, but I haven't yet found a method of consolidating the setting into one place where Serilog can find the right config, and the LogViewer code can also find the same setting.
Interested to know if anybody knows how!
@andy , finally figure out how to get this to work in multi env . We have a prod / test / dev , in azure so using the azure server variables works well . when moving from env to env .
is working on a reply...