本文整理汇总了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();
}