-
-
Save vchircu/13105165d37d7090e6b4bdb849328054 to your computer and use it in GitHub Desktop.
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 LoggerBehavior : IBehavior<IncomingContext> | |
{ | |
private static readonly ILog logger = LogManager.GetLogger(typeof(LoggerBehavior)); | |
public void Invoke(IncomingContext context, Action next) | |
{ | |
try | |
{ | |
logger.Info("Entered the behavior."); | |
next(); | |
logger.Info("Exited the behavior."); | |
} | |
catch (Exception ex) | |
{ | |
logger.Error("Finished processing with errors.", ex); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment