コード例 #1
0
 /// <summary>
 /// 设置来源
 /// </summary>
 private void SetSource(EventBuilder builder, ILogContent content)
 {
     if (string.IsNullOrWhiteSpace(content.Url))
     {
         return;
     }
     builder.SetSource(content.Url);
 }
コード例 #2
0
 /// <summary>
 /// 添加属性集合
 /// </summary>
 private void AddProperties(EventBuilder builder, ILogConvert content)
 {
     if (content == null)
     {
         return;
     }
     foreach (var parameter in content.To().OrderBy(t => t.SortId))
     {
         if (string.IsNullOrWhiteSpace(parameter.Value.SafeString()))
         {
             continue;
         }
         builder.SetProperty($"{GetLine()}. {parameter.Text}", parameter.Value);
     }
 }
コード例 #3
0
 /// <summary>
 /// Adds the recent trace log entries to the event.
 /// </summary>
 /// <param name="builder">The event builder object.</param>
 /// <param name="listener">The listener.</param>
 /// <param name="maxEntriesToInclude"></param>
 public static EventBuilder AddRecentTraceLogEntries(this EventBuilder builder, ExceptionlessTraceListener listener = null, int maxEntriesToInclude = TraceLogPlugin.DefaultMaxEntriesToInclude)
 {
     TraceLogPlugin.AddRecentTraceLogEntries(builder.Target, listener, maxEntriesToInclude);
     return(builder);
 }
コード例 #4
0
 public static EventBuilder SetHttpContext(this EventBuilder builder, HttpContext context)
 {
     builder.PluginContextData["HttpContext"] = context;
     return(builder);
 }
コード例 #5
0
 /// <summary>
 /// Changes default stacking behavior by setting the stacking key.
 /// </summary>
 /// <param name="builder">The event builder object.</param>
 /// <param name="manualStackingKey">The manual stacking key.</param>
 public static EventBuilder SetManualStackingKey(this EventBuilder builder, string manualStackingKey)
 {
     builder.Target.SetManualStackingKey(manualStackingKey);
     return(builder);
 }
コード例 #6
0
 /// <summary>
 /// Changes default stacking behavior by setting the stacking key.
 /// </summary>
 /// <param name="builder">The event builder object.</param>
 /// <param name="title">The stack title.</param>
 /// <param name="signatureData">Key value pair that determines how the event is stacked.</param>
 public static EventBuilder SetManualStackingInfo(this EventBuilder builder, string title, IDictionary <string, string> signatureData)
 {
     builder.Target.SetManualStackingInfo(title, signatureData);
     return(builder);
 }
コード例 #7
0
 /// <summary>
 /// Sets the version that the event happened on.
 /// </summary>
 /// <param name="builder">The event builder object.</param>
 /// <param name="version">The version.</param>
 public static EventBuilder SetVersion(this EventBuilder builder, string version)
 {
     builder.Target.SetVersion(version);
     return(builder);
 }
コード例 #8
0
 /// <summary>
 /// Sets the user's description of the event.
 /// </summary>
 /// <param name="builder">The event builder object.</param>
 /// <param name="emailAddress">The user's email address.</param>
 /// <param name="description">The user's description of the event.</param>
 public static EventBuilder SetUserDescription(this EventBuilder builder, string emailAddress, string description)
 {
     builder.Target.SetUserDescription(emailAddress, description);
     return(builder);
 }
コード例 #9
0
 /// <summary>
 /// Sets the user's identity (ie. email address, username, user id) that the event happened to.
 /// </summary>
 /// <param name="builder">The event builder object.</param>
 /// <param name="identity">The user's identity that the event happened to.</param>
 /// <param name="name">The user's friendly name that the event happened to.</param>
 public static EventBuilder SetUserIdentity(this EventBuilder builder, string identity, string name)
 {
     builder.Target.SetUserIdentity(identity, name);
     return(builder);
 }
コード例 #10
0
 /// <summary>
 /// Adds the current request info as extended data to the event.
 /// </summary>
 /// <param name="builder">The event builder.</param>
 /// <param name="context">The http action context to gather information from.</param>
 public static EventBuilder AddHttpRequestInfo(this EventBuilder builder, HttpActionContext context)
 {
     builder.Target.AddHttpRequestInfo(context);
     return(builder);
 }
コード例 #11
0
 /// <summary>
 /// Adds the current request info to the event.
 /// </summary>
 /// <param name="builder">The event builder.</param>
 public static EventBuilder AddRequestInfo(this EventBuilder builder)
 {
     builder.Target.AddRequestInfo(builder.Client);
     return(builder);
 }
コード例 #12
0
 /// <summary>
 /// 添加标签
 /// </summary>
 private void AddTags(EventBuilder builder, ILogContent content) => builder.AddTags(content.Level, content.LogName, content.TraceId);
コード例 #13
0
 /// <summary>
 /// 设置跟踪号
 /// </summary>
 private void SetReferenceId(EventBuilder builder, ILogContent content) => builder.SetReferenceId($"{content.LogId}");
コード例 #14
0
 /// <summary>
 /// Adds the current request info as extended data to the event.
 /// </summary>
 /// <param name="builder">The event builder.</param>
 /// <param name="context">The nancy context to gather information from.</param>
 public static EventBuilder AddRequestInfo(this EventBuilder builder, NancyContext context)
 {
     builder.Target.AddRequestInfo(context);
     return(builder);
 }
コード例 #15
0
 /// <summary>
 /// Sets the user's identity (ie. email address, username, user id) that the event happened to.
 /// </summary>
 /// <param name="builder">The event builder object.</param>
 /// <param name="userInfo">The user's identity that the event happened to.</param>
 public static EventBuilder SetUserIdentity(this EventBuilder builder, UserInfo userInfo)
 {
     builder.Target.SetUserIdentity(userInfo);
     return(builder);
 }
コード例 #16
0
 /// <summary>
 /// Adds the current request info as extended data to the event.
 /// </summary>
 /// <param name="builder">The event builder.</param>
 /// <param name="context">The http context to gather information from.</param>
 public static EventBuilder AddRequestInfo(this EventBuilder builder, HttpContext context)
 {
     builder.Target.AddRequestInfo(context, builder.Client.Configuration);
     return(builder);
 }
コード例 #17
0
 /// <summary>
 /// Adds the recent trace log entries to the event.
 /// </summary>
 /// <param name="builder">The event builder object.</param>
 public static EventBuilder AddRecentTraceLogEntries(this EventBuilder builder)
 {
     TraceLogEnrichment.AddRecentTraceLogEntries(builder.Target);
     return(builder);
 }