Configuring Azure app services logging for ASP.Net Core application

If you are using Azure to host your ASP.Net Core website and don’t want to spend time configuring logging in your web application, then you can use Azure App services logging. Here are the changes that you need to make in your web application to configure logging.

Startup.cs:


using Microsoft.Extensions.Logging.AzureAppServices;
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
         services.Configure<AzureFileLoggerOptions>
(Configuration.GetSection("AzureAppServicesLogging"));
} }

AppSettings.json:


{
"AzureAppServicesLogging": {
"BlobName": "Log.txt"
}
}

I have also turned Detailed error messages on, so I can more glean more details if an error occurs.

image

image

You may also like

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.