当前位置: 首页>>代码示例>>C#>>正文


C# LoggingEvent.MakePartitionKey方法代码示例

本文整理汇总了C#中log4net.Core.LoggingEvent.MakePartitionKey方法的典型用法代码示例。如果您正苦于以下问题:C# LoggingEvent.MakePartitionKey方法的具体用法?C# LoggingEvent.MakePartitionKey怎么用?C# LoggingEvent.MakePartitionKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在log4net.Core.LoggingEvent的用法示例。


在下文中一共展示了LoggingEvent.MakePartitionKey方法的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();
        }
开发者ID:Thumann,项目名称:log4net.Azure,代码行数:31,代码来源:AzureLoggingEventEntity.cs

示例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();
        }
开发者ID:Thumann,项目名称:log4net.Azure,代码行数:30,代码来源:AzureDynamicLoggingEventEntity.cs

示例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();
        }
开发者ID:Thumann,项目名称:log4net.Azure,代码行数:15,代码来源:AzureLayoutLoggingEventEntity.cs


注:本文中的log4net.Core.LoggingEvent.MakePartitionKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。