Skip to content

Instantly share code, notes, and snippets.

@fabriciosanchez
Created May 26, 2014 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabriciosanchez/6fb65ad078f0811eeda4 to your computer and use it in GitHub Desktop.
Save fabriciosanchez/6fb65ad078f0811eeda4 to your computer and use it in GitHub Desktop.
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