Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Owin Middleware
public class LoggerMiddleware : OwinMiddleware
{
private readonly ILog _logger;
public LoggerMiddleware(OwinMiddleware next, ILog logger) : base(next)
{
_logger = logger;
}
public override async Task Invoke(IOwinContext context)
{
_logger.LogInfo("Middleware begin");
await this.Next.Invoke(context);
_logger.LogInfo("Middleware end");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment