AzureDataCollectorLoggingProvider 1.0.0

As of 01/23/2018 you can send data to Azure Log Analytics with the HTTP Data Collector API (public preview) from a REST API client. This package implements this as a Logging Provider for ASP.NET Standard 2.0
https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-data-collector-api

There is a newer version of this package available.
See the version list below for details.
Install-Package AzureDataCollectorLoggingProvider -Version 1.0.0
dotnet add package AzureDataCollectorLoggingProvider --version 1.0.0
paket add AzureDataCollectorLoggingProvider --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

.NET Standard 2.0 Logger Provider for the Azure HTTP Data Collector API (public preview) in Log Analytics

https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-data-collector-api
(Much of the content from the above page is copied herein as the author may make changes)

An (see cref="T:Microsoft.Extensions.Logging.ILoggerProvider" ) that writes logs to the
Azure Analytics HTTP Data Collector API with file system fail-back

A significant challenge in this design is managing to the potentially disconnected 
environment without losing data. This logging provider will fail-back to a local file 
system logger when disconnected, and then purge the local log files when connectivity
returns. A maximum number of local log files and their maximum size can be set in 
the options, and any loss of data will be reported when connectivity resumes.
Initially I envisioned this derived from NetEscapades.Extensions.Logging.RollingFile.FileLogger
to handle the fail-back, but after some trial and error concluded that the LogMessage Type
desired for the Azure Data Collector Provider requires more structure than that required
by the FileLogger. Complicated largely by the definition of LogMessage as a Struct, so I've 
blatantly copied and modified the FileLogger as seems appropriate.

.NET Standard 2.0 Logger Provider for the Azure HTTP Data Collector API (public preview) in Log Analytics

https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-data-collector-api
(Much of the content from the above page is copied herein as the author may make changes)

An (see cref="T:Microsoft.Extensions.Logging.ILoggerProvider" ) that writes logs to the
Azure Analytics HTTP Data Collector API with file system fail-back

A significant challenge in this design is managing to the potentially disconnected 
environment without losing data. This logging provider will fail-back to a local file 
system logger when disconnected, and then purge the local log files when connectivity
returns. A maximum number of local log files and their maximum size can be set in 
the options, and any loss of data will be reported when connectivity resumes.
Initially I envisioned this derived from NetEscapades.Extensions.Logging.RollingFile.FileLogger
to handle the fail-back, but after some trial and error concluded that the LogMessage Type
desired for the Azure Data Collector Provider requires more structure than that required
by the FileLogger. Complicated largely by the definition of LogMessage as a Struct, so I've 
blatantly copied and modified the FileLogger as seems appropriate.

Release Notes

I've been coding since 1986, professionally since 1980, yet this is my first public release.

Referenced https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-data-collector-api and NetEscapades.Extensions.Logging.RollingFile during development

Version History

Version Downloads Last updated
2.1.1.1 102 11/26/2018
2.1.1 87 11/26/2018
1.0.0 318 4/6/2018