Integrated Elmah-logging in Nancy
Install via nuget https://nuget.org/packages/Nancy.Elmah
PM> Install-Package Nancy.Elmah
Or build from source and drop Nancy.Elmah.dll and Elmah.dll into your solution
namespace Nancy.Elmah.Asp.Net.Example
{
public class Bootstrapper : DefaultNancyBootstrapper
{
protected override void ApplicationStartup(TinyIoc.TinyIoCContainer container, Nancy.Bootstrapper.IPipelines pipelines)
{
base.ApplicationStartup(container, pipelines);
Elmahlogging.Enable(pipelines, "elmah");
}
}
}
namespace Nancy.Elmah.Asp.Net.Example
{
public class Bootstrapper : DefaultNancyBootstrapper
{
protected override void ApplicationStartup(TinyIoc.TinyIoCContainer container, Nancy.Bootstrapper.IPipelines pipelines)
{
base.ApplicationStartup(container, pipelines);
Elmahlogging.Enable(pipelines, "elmah", new []{"administrator"});
}
}
}
namespace Nancy.Elmah.Asp.Net.Example
{
public class Bootstrapper : DefaultNancyBootstrapper
{
protected override void ApplicationStartup(TinyIoc.TinyIoCContainer container, Nancy.Bootstrapper.IPipelines pipelines)
{
base.ApplicationStartup(container, pipelines);
Elmahlogging.Enable(pipelines, "elmah", new string[0], new HttpStatusCode[] { HttpStatusCode.NotFound, HttpStatusCode.InsufficientStorage, });
}
}
}