Implementation and usage of logger wrapper for log4net
问题 This question is related to Steven’s answer - here. He proposed a very good logger wrapper. I will paste his code below: public interface ILogger { void Log(LogEntry entry); } public static class LoggerExtensions { public static void Log(this ILogger logger, string message) { logger.Log(new LogEntry(LoggingEventType.Information, message, null)); } public static void Log(this ILogger logger, Exception exception) { logger.Log(new LogEntry(LoggingEventType.Error, exception.Message, exception));