Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 1.12 KB

README.md

File metadata and controls

30 lines (21 loc) · 1.12 KB

Elmah.Io.Extensions.Logging

Build status NuGet

Log to elmah.io from Microsoft.Extensions.Logging.

Installation

Elmah.Io.Extensions.Logging installs through NuGet:

PS> Install-Package Elmah.Io.Extensions.Logging

Configure the elmah.io provider through code:

var factory = new LoggerFactory();
factory.AddElmahIo("API_KEY", new Guid("LOG_ID"));
var logger = factory.CreateLogger("MyLog");

In the example we create a new LoggerFactory and add the elmah.io provider using the AddElmahIo extension method, an API key and the Guid of the desired log. Finally, we create a new logger which is used later in this example to log messages to elmah.io.

Usage

Log messages to elmah.io, just as with every other provider:

logger.LogInformation("This is information");