本文整理匯總了C#中log4net.Core.LoggingEvent.MakeRowKey方法的典型用法代碼示例。如果您正苦於以下問題:C# LoggingEvent.MakeRowKey方法的具體用法?C# LoggingEvent.MakeRowKey怎麽用?C# LoggingEvent.MakeRowKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類log4net.Core.LoggingEvent
的用法示例。
在下文中一共展示了LoggingEvent.MakeRowKey方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AzureLoggingEventEntity
public AzureLoggingEventEntity(LoggingEvent e, PartitionKeyTypeEnum partitionKeyType)
{
Domain = e.Domain;
Identity = e.Identity;
Level = e.Level.ToString();
var sb = new StringBuilder(e.Properties.Count);
foreach (DictionaryEntry entry in e.Properties)
{
sb.AppendFormat("{0}:{1}", entry.Key, entry.Value);
sb.AppendLine();
}
Properties = sb.ToString();
Message = e.RenderedMessage + Environment.NewLine + e.GetExceptionString();
ThreadName = e.ThreadName;
EventTimeStamp = e.TimeStamp;
UserName = e.UserName;
Location = e.LocationInformation.FullInfo;
ClassName = e.LocationInformation.ClassName;
FileName = e.LocationInformation.FileName;
LineNumber = e.LocationInformation.LineNumber;
MethodName = e.LocationInformation.MethodName;
StackFrames = e.LocationInformation.StackFrames;
if (e.ExceptionObject != null)
{
Exception = e.ExceptionObject.ToString();
}
PartitionKey = e.MakePartitionKey(partitionKeyType);
RowKey = e.MakeRowKey();
}
示例2: AzureDynamicLoggingEventEntity
public AzureDynamicLoggingEventEntity(LoggingEvent e, PartitionKeyTypeEnum partitionKeyType)
{
this["Domain"] = e.Domain;
this["Identity"] = e.Identity;
this["Level"] = e.Level.ToString();
this["LoggerName"] = e.LoggerName;
this["Message"] = e.RenderedMessage + Environment.NewLine + e.GetExceptionString();
this["EventTimeStamp"] = e.TimeStamp;
this["ThreadName"] = e.ThreadName;
this["UserName"] = e.UserName;
this["Location"] = e.LocationInformation.FullInfo;
if (e.ExceptionObject != null)
{
this["Exception"] = e.ExceptionObject.ToString();
}
foreach (DictionaryEntry entry in e.Properties)
{
var key = entry.Key.ToString()
.Replace(":", "_")
.Replace("@", "_")
.Replace(".", "_");
this[key] = entry.Value;
}
Timestamp = e.TimeStamp;
PartitionKey = e.MakePartitionKey(partitionKeyType);
RowKey = e.MakeRowKey();
}
示例3: AzureLayoutLoggingEventEntity
public AzureLayoutLoggingEventEntity(LoggingEvent e, PartitionKeyTypeEnum partitionKeyType, ILayout layout)
{
Level = e.Level.ToString();
Message = e.RenderedMessage + Environment.NewLine + e.GetExceptionString();
ThreadName = e.ThreadName;
EventTimeStamp = e.TimeStamp;
using (var w = new StringWriter())
{
layout.Format(w, e);
Message = w.ToString();
}
PartitionKey = e.MakePartitionKey(partitionKeyType);
RowKey = e.MakeRowKey();
}