BlueSkyDev.Logging.AzureEventHubAppender
1.1.0-CI-20200103-191040
See the version list below for details.
dotnet add package BlueSkyDev.Logging.AzureEventHubAppender --version 1.1.0-CI-20200103-191040
NuGet\Install-Package BlueSkyDev.Logging.AzureEventHubAppender -Version 1.1.0-CI-20200103-191040
<PackageReference Include="BlueSkyDev.Logging.AzureEventHubAppender" Version="1.1.0-CI-20200103-191040" />
paket add BlueSkyDev.Logging.AzureEventHubAppender --version 1.1.0-CI-20200103-191040
#r "nuget: BlueSkyDev.Logging.AzureEventHubAppender, 1.1.0-CI-20200103-191040"
// Install BlueSkyDev.Logging.AzureEventHubAppender as a Cake Addin
#addin nuget:?package=BlueSkyDev.Logging.AzureEventHubAppender&version=1.1.0-CI-20200103-191040&prerelease
// Install BlueSkyDev.Logging.AzureEventHubAppender as a Cake Tool
#tool nuget:?package=BlueSkyDev.Logging.AzureEventHubAppender&version=1.1.0-CI-20200103-191040&prerelease
Introduction
This project is a log4net appender that will write to an Azure Event Hub.
This Appender has a front end that takes in messages. A blocking collection is used as a buffer between the front end and the backend. As the front end taked in messages, they are stored in the blocking collection. The backend is a thread that reads from the blocking collection and sends messages to the event hub. If there are multiple messages available they will be sent to the event hub.
Getting Started
Add a Nuget reference to BlueSkyDev.Logging.AzureEventHubAppender (URL TBD)
For a .NET Framework application add the following log4net configuration to either your log4net.config file or yout app.config file.
<?xml version="1.0" encoding="utf-8"?>
<log4net>
<root>
<level value="INFO"/>
<appender-ref ref="AzureEventHubAppender"/>
</root>
<appender name="AzureEventHubAppender" type="BlueSkyDev.Logging.AzureEventHubAppender, BlueSkyDev.Logging.AzureEventHubAppender">
<param name="ConnectionString" value="" />
<param name="BufferSize" value="3000" />
<param name="BatchSize" value="200" />
<param name="LogAsJson" value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="date=%utcdate|Thread=%thread|Message=%message|Level=%level|Logger=%logger" />
</layout>
</appender>
</log4net>
NOTE: By default, the logger will produce a JSON output. In order to make sure this works properly, make sure your conversionPattern
value has a delimited format of "key1=%pattern1|key2=%pattern2|key3=%pattern3"
. This will allow the appender to parse the pattern and generate the JSON that gets sent to the EventHub.
If you want to send the pattern as you have written it, change the LogAsJson
parameter value to false
.
You can set your ConnectionString via an Environment Variable named AzureEventHubAppenderConnectionString
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- log4net (>= 2.0.8)
- Microsoft.Azure.EventHubs (>= 4.1.0)
- Newtonsoft.Json (>= 12.0.3)
- System.Configuration.ConfigurationManager (>= 4.7.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.3.2 | 667 | 4/12/2021 |
1.3.0 | 656 | 12/11/2020 |
1.2.1 | 642 | 7/6/2020 |
1.2.0-CI-20200609-131213 | 343 | 6/9/2020 |
1.1.0-CI-20200103-191040 | 402 | 1/3/2020 |