/// <summary> /// 设置来源 /// </summary> private void SetSource(EventBuilder builder, ILogContent content) { if (string.IsNullOrWhiteSpace(content.Url)) { return; } builder.SetSource(content.Url); }
/// <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); } }
/// <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); }
public static EventBuilder SetHttpContext(this EventBuilder builder, HttpContext context) { builder.PluginContextData["HttpContext"] = context; return(builder); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <summary> /// 添加标签 /// </summary> private void AddTags(EventBuilder builder, ILogContent content) => builder.AddTags(content.Level, content.LogName, content.TraceId);
/// <summary> /// 设置跟踪号 /// </summary> private void SetReferenceId(EventBuilder builder, ILogContent content) => builder.SetReferenceId($"{content.LogId}");
/// <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); }
/// <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); }
/// <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); }
/// <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); }