-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,25 @@ | ||
# EventHubLogger | ||
Implementation of .netcore ILogger for Azure Event Hub | ||
|
||
### Installation | ||
**Install** the Daenet.Common.Logging.EventHub [NuGet Package](http:// "Link missing") in your application. | ||
|
||
### Configuration | ||
|
||
**Following code block**, shows how to add EventHubLogger provider to the loggerFactory in EventHubLoggerUnitTests class: | ||
```C# | ||
private void initializeEventHubLogger(Func<string, LogLevel, bool> filter, | ||
Func<LogLevel, EventId, object, Exception, EventData> eventDataFormatter = null, | ||
Dictionary<string, object> additionalValues = null) | ||
{ | ||
ConfigurationBuilder cfgBuilder = new ConfigurationBuilder(); | ||
cfgBuilder.AddJsonFile(@"EventHubLoggerSettings.json"); | ||
var configRoot = cfgBuilder.Build(); | ||
|
||
ILoggerFactory loggerFactory = new LoggerFactory() | ||
.AddEventHub(configRoot.GetEventHubLoggerSettings(), filter, eventDataFormatter, additionalValues); | ||
|
||
m_Logger = loggerFactory.CreateLogger<EventHubLoggerUnitTests>(); | ||
} | ||
``` | ||
Following configuration needs to be added in the ***EventHubLoggerSettings.json*** file. |