Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Ataulhaye authored Jul 6, 2017
1 parent 0ae6a7a commit 39aeef2
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
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.

0 comments on commit 39aeef2

Please sign in to comment.