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


C# PersistentEvent.GetRequestInfo方法代码示例

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


在下文中一共展示了PersistentEvent.GetRequestInfo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetEventSummaryData

        public override SummaryData GetEventSummaryData(PersistentEvent ev) {
            if (!ShouldHandle(ev))
                return null;

            var error = ev.GetError();
            var stackingTarget = error?.GetStackingTarget();
            if (stackingTarget?.Error == null)
                return null;

            dynamic data = new ExpandoObject();
            data.Id = ev.Id;
            data.Message = ev.Message;

            if (!String.IsNullOrEmpty(stackingTarget.Error.Type)) {
                data.Type = stackingTarget.Error.Type.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries).Last();
                data.TypeFullName = stackingTarget.Error.Type;
            }

            if (stackingTarget.Method != null) {
                data.Method = stackingTarget.Method.Name;
                data.MethodFullName = stackingTarget.Method.GetFullName();
            }

            var requestInfo = ev.GetRequestInfo();
            if (!String.IsNullOrEmpty(requestInfo?.Path))
                data.Path = requestInfo.Path;

            return new SummaryData { TemplateKey = "event-error-summary", Data = data };
        }
开发者ID:Nangal,项目名称:Exceptionless,代码行数:29,代码来源:20_ErrorFormattingPlugin.cs

示例2: GetEventSummaryData

        public override SummaryData GetEventSummaryData(PersistentEvent ev) {
            if (!ShouldHandle(ev))
                return null;
            
            var stackingTarget = ev.GetStackingTarget();
            if (stackingTarget?.Error == null)
                return null;

            var data = new Dictionary<string, object> { { "Id", ev.Id }, { "Message", ev.Message } };
            if (!String.IsNullOrEmpty(stackingTarget.Error.Type)) {
                data.Add("Type", stackingTarget.Error.Type.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries).Last());
                data.Add("TypeFullName", stackingTarget.Error.Type);
            }

            if (stackingTarget.Method != null) {
                data.Add("Method", stackingTarget.Method.Name);
                data.Add("MethodFullName", stackingTarget.Method.GetFullName());
            }

            var requestInfo = ev.GetRequestInfo();
            if (!String.IsNullOrEmpty(requestInfo?.Path))
                data.Add("Path", requestInfo.Path);

            return new SummaryData { TemplateKey = "event-error-summary", Data = data };
        }
开发者ID:rpotalara,项目名称:Exceptionless,代码行数:25,代码来源:20_ErrorFormattingPlugin.cs

示例3: GetIpAddresses

        private IEnumerable<string> GetIpAddresses(PersistentEvent ev) {
            if (!String.IsNullOrEmpty(ev.Geo) && (ev.Geo.Contains(".") || ev.Geo.Contains(":")))
                yield return ev.Geo;

            var request = ev.GetRequestInfo();
            if (!String.IsNullOrWhiteSpace(request?.ClientIpAddress))
                yield return request.ClientIpAddress;

            var environmentInfo = ev.GetEnvironmentInfo();
            if (String.IsNullOrWhiteSpace(environmentInfo?.IpAddress))
                yield break;

            foreach (var ip in environmentInfo.IpAddress.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
                yield return ip;
        }
开发者ID:Nangal,项目名称:Exceptionless,代码行数:15,代码来源:50_GeoPlugin.cs

示例4: GetEventSummaryData

        public override SummaryData GetEventSummaryData(PersistentEvent ev) {
            if (!ShouldHandle(ev))
                return null;

            var error = ev.GetSimpleError();
            if (error == null)
                return null;
            
            var data = new Dictionary<string, object> { { "Message", ev.Message } };
            if (!String.IsNullOrEmpty(error.Type)) {
                data.Add("Type", error.Type.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries).Last());
                data.Add("TypeFullName", error.Type);
            }

            var requestInfo = ev.GetRequestInfo();
            if (!String.IsNullOrEmpty(requestInfo?.Path))
                data.Add("Path", requestInfo.Path);

            return new SummaryData { TemplateKey = "event-simple-summary", Data = data };
        }
开发者ID:rpotalara,项目名称:Exceptionless,代码行数:20,代码来源:10_SimpleErrorFormattingPlugin.cs

示例5: GetEventSummaryData

        public override SummaryData GetEventSummaryData(PersistentEvent ev) {
            if (!ShouldHandle(ev))
                return null;

            var error = ev.GetSimpleError();
            if (error == null)
                return null;

            dynamic data = new ExpandoObject();
            data.Message = ev.Message;

            if (!String.IsNullOrEmpty(error.Type)) {
                data.Type = error.Type.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries).Last();
                data.TypeFullName = error.Type;
            }

            var requestInfo = ev.GetRequestInfo();
            if (!String.IsNullOrEmpty(requestInfo?.Path))
                data.Path = requestInfo.Path;

            return new SummaryData { TemplateKey = "event-simple-summary", Data = data };
        }
开发者ID:Nangal,项目名称:Exceptionless,代码行数:22,代码来源:10_SimpleErrorFormattingPlugin.cs


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