Updates async logging to a newer format

This commit is contained in:
Shannon
2015-07-01 13:46:11 +02:00
parent 56315768e9
commit 44943e367f
15 changed files with 1391 additions and 419 deletions

View File

@@ -0,0 +1,31 @@
using System;
using log4net.Core;
namespace Umbraco.Core.Logging
{
/// <remarks>
/// Based on https://github.com/cjbhaines/Log4Net.Async
/// </remarks>
internal class LoggingEventHelper
{
// needs to be a seperate class so that location is determined correctly by log4net when required
private static readonly Type HelperType = typeof(LoggingEventHelper);
private readonly string loggerName;
public FixFlags Fix { get; set; }
public LoggingEventHelper(string loggerName, FixFlags fix)
{
this.loggerName = loggerName;
Fix = fix;
}
public LoggingEvent CreateLoggingEvent(Level level, string message, Exception exception)
{
var loggingEvent = new LoggingEvent(HelperType, null, loggerName, level, message, exception);
loggingEvent.Fix = Fix;
return loggingEvent;
}
}
}