Raw client for communicating with the elmah.io API.
To start logging, create a new instance of the
client = ElmahioAPI.Create(apiKey);
apiKey is your API key found on your profile page at elmah.io.
Log messages either through the
client.Messages.Log(logId, new Exception(), Severity.Error, "This is a bug");
or through one of the helpers:
client.Messages.Debug(logId, "A debug message"); client.Messages.Fatal(logId, exception, "This is a fatal bug");
Logs are containers for log messages. To create a new log for a new application, microservice or similar, use the
client.Logs.Create(new CreateLog("My log"));
Parts of this client is auto generated using AutoRest. AutoRest is a brilliant code generation tools by Microsoft, that takes swagger input and generates client libraries for a number of different programming languages (like C#).
To generate a client of the most recent code, execute the following in the root folder:
AutoRest.exe -Input https://api.elmah.io:443/swagger/docs/v3 -AddCredentials true -Namespace Elmah.Io.Client -OutputDirectory Elmah.Io.Client