Created
June 21, 2017 18:20
-
-
Save yaplex/8714682fedad0c8a88e4460988ed336e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| using System.Diagnostics; | |
| using log4net.Appender; | |
| using log4net.Core; | |
| public class AzureAppender : AppenderSkeleton | |
| { | |
| protected override void Append(LoggingEvent loggingEvent) | |
| { | |
| string logString = RenderLoggingEvent(loggingEvent); | |
| switch (loggingEvent.Level.Name) | |
| { | |
| case "ERROR": | |
| Trace.TraceError(logString); | |
| break; | |
| case "WARN": | |
| Trace.TraceWarning(logString); | |
| break; | |
| case "INFO": | |
| Trace.TraceInformation(logString); | |
| break; | |
| default: | |
| Trace.Write(logString); | |
| break; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment