Created
May 26, 2014 18:20
-
-
Save fabriciosanchez/6fb65ad078f0811eeda4 to your computer and use it in GitHub Desktop.
Owin Middleware
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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