If you are a Slack addicted this is the logger for you!
This project is not a part of NET Core or ASP.NET Core and is not provider by Microsoft.
This is a logged implementation for Microsoft.Extensions.Logging
who will log into Slack.
The only reason why the name is starting with Microsoft.Extensions.Logging
is for "convention" with the other loggers released by Microsoft.
Here http://tostring.it/2015/11/23/Log-your-application-errors-into-Slack/ more information about the approach.
Right now is working with net451 & netstandard 1.3
The output should be something like this
PM> Install-Package Microsoft.Extensions.Logging.Slack
The package is almost done, but not release yet (need to write the unit tests), soon on nuget.
How to use it?
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHostingEnvironment env)
{
var configuration = new SlackConfiguration()
{
WebhookUrl = "http://tostring.it",
MinLevel = MinLevel.Error
}
app.AddSlack(configuration, env)
}
or
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
{
var configuration = new SlackConfiguration()
{
WebhookUrl = "http://tostring.it",
MinLevel = MinLevel.Error
}
app.AddSlack(configuration, env, "my application name", "my application environment")
}
To retrieve the right webhook url, follow the steps below:
Have fun!