Last active
August 29, 2015 14:06
-
-
Save MiniverCheevy/4a72daeba29e482205ba to your computer and use it in GitHub Desktop.
Voodoo.Logging.ILogger Implementations
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 ElmahLogger: Voodoo.Logging.ILogger | |
{ | |
public void Log(string message) | |
{ | |
using (var scope = new TransactionScope(TransactionScopeOption.Suppress)) | |
{ | |
var exception = new Exception(message); | |
ErrorSignal.FromCurrentContext().Raise(exception); | |
} | |
} | |
public void Log(Exception ex) | |
{ | |
using (var scope = new TransactionScope(TransactionScopeOption.Suppress)) | |
{ | |
ErrorSignal.FromCurrentContext().Raise(ex); | |
} | |
} | |
} |
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 NLogLogger : Voodoo.Logging.ILogger | |
{ | |
private static Logger logger = LogManager.GetCurrentClassLogger(); | |
public void Log(string message) | |
{ | |
logger.Log(LogLevel.Error, message); | |
} | |
public void Log(Exception ex) | |
{ | |
logger.Log(LogLevel.Error, ex.ToString()); | |
} | |
} |
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 ExceptionalLogger: Voodoo.Logging.ILogger | |
{ | |
public void Log(string message) | |
{ | |
ErrorStore.LogException(new Exception(message), HttpContext.Current); | |
} | |
public void Log(Exception ex) | |
{ | |
ErrorStore.LogException(ex, HttpContext.Current); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment