Basic MVC app to demonstrate application logging in an Azure Gov dev slot. Also includes a console app for local testing.
This project uses the Serilog.AspNetCore
and Serilog.Sinks.Trace
Configuration information can be found at the Serilog website. There is also a sample application.
Application diagnostics are enabled in the Azure console. Logs can go to the file system and/or blob storage. ASP.NET applications use `System.Diagnostics.Trace to log information. See Enable Diagnostics Log for more information.
The Azure Diagnostic Log Stream ships events from any files in the D:\home\LogFiles\
folder. There are some details on configuration in the Serilog README.
It is possible to use the Serilog file sink to log directly to the Application Log folder which will allow application logging and streaming. The Application Log folder appears to have two file limit with 10MB file limit (how this is rotated is not clear) so another way to capture these logs is probably necessary for auditing.
A sample project can be found in the Serilog source on GitHub.
Logging in .Net Core has been updated and now uses a logging API.
AzureAppService Provider for AspNetCore writes logs to Azure's Diagnostic Application Logs -- file system with log streaming and blob storage.
Diagnostics should be enabled in the portal. Note that previous documentation using System.Diagnostics.Trace
does not appear to generate Azure Diagnostic Application logs with the latest release.
To view the console
trace use the DebugView
application which is available here from Microsoft SysInternals site.
Required to get the logger working with Azure Diagnostic Logs
https://www.nuget.org/packages/Microsoft.Extensions.Logging.AzureAppServices/