/// <summary> /// Creates a resource not found event. /// </summary> /// <param name="client">The client instance.</param> /// <param name="resource">The name of the resource that was not found.</param> public static EventBuilder CreateNotFound(this ExceptionlessClient client, string resource) { if (client == null) { throw new ArgumentNullException(nameof(client)); } return(client.CreateEvent().SetType(Event.KnownTypes.NotFound).SetSource(resource)); }
/// <summary> /// Creates a session start event. /// </summary> /// <param name="client">The client instance.</param> public static EventBuilder CreateSessionStart(this ExceptionlessClient client) { if (client == null) { throw new ArgumentNullException(nameof(client)); } return(client.CreateEvent().SetType(Event.KnownTypes.Session)); }
/// <summary> /// Creates a log message event. /// </summary> /// <param name="client">The client instance.</param> /// <param name="message">The log message.</param> public static EventBuilder CreateLog(this ExceptionlessClient client, string message) { if (client == null) { throw new ArgumentNullException(nameof(client)); } return(client.CreateEvent().SetType(Event.KnownTypes.Log).SetMessage(message)); }
/// <summary> /// Creates a feature usage event. /// </summary> /// <param name="client">The client instance.</param> /// <param name="feature">The name of the feature that was used.</param> public static EventBuilder CreateFeatureUsage(this ExceptionlessClient client, string feature) { if (client == null) { throw new ArgumentNullException(nameof(client)); } return(client.CreateEvent().SetType(Event.KnownTypes.FeatureUsage).SetSource(feature)); }
/// <summary> /// Creates a builder object for constructing error reports in a fluent api. /// </summary> /// <param name="exception">The exception.</param> /// <param name="pluginContextData"> /// Any contextual data objects to be used by Exceptionless plugins to gather default /// information for inclusion in the report information. /// </param> /// <param name="client"> /// The ExceptionlessClient instance used for configuration. If a client is not specified, it will use /// ExceptionlessClient.Default. /// </param> /// <returns></returns> public static EventBuilder ToExceptionless(this Exception exception, ContextData pluginContextData = null, ExceptionlessClient client = null) { if (client == null) client = ExceptionlessClient.Default; if (pluginContextData == null) pluginContextData = new ContextData(); pluginContextData.SetException(exception); return client.CreateEvent(pluginContextData); }
/// <summary> /// Creates a builder object for constructing error reports in a fluent api. /// </summary> /// <param name="exception">The exception.</param> /// <param name="client"> /// The ExceptionlessClient instance used for configuration. /// </param> /// <returns></returns> public static EventBuilder ToExceptionless(this Exception exception, ExceptionlessClient client) { if (client == null) { throw new ArgumentNullException(nameof(client)); } var pluginContextData = new ContextData(); pluginContextData.SetException(exception); return(client.CreateEvent(pluginContextData).SetType(Event.KnownTypes.Error)); }
/// <summary> /// Creates a builder object for constructing error reports in a fluent api. /// </summary> /// <param name="exception">The exception.</param> /// <param name="pluginContextData"> /// Any contextual data objects to be used by Exceptionless plugins to gather default /// information for inclusion in the report information. /// </param> /// <param name="client"> /// The ExceptionlessClient instance used for configuration. If a client is not specified, it will use /// ExceptionlessClient.Default. /// </param> /// <returns></returns> public static EventBuilder ToExceptionless(this Exception exception, ContextData pluginContextData = null, ExceptionlessClient client = null) { if (client == null) { client = ExceptionlessClient.Default; } if (pluginContextData == null) { pluginContextData = new ContextData(); } pluginContextData.SetException(exception); return(client.CreateEvent(pluginContextData).SetType(Event.KnownTypes.Error)); }
/// <summary> /// Creates a builder object for constructing error reports in a fluent api. /// </summary> /// <param name="exception">The exception.</param> /// <param name="enrichmentContextData"> /// Any contextual data objects to be used by Exceptionless plugins to gather default /// information for inclusion in the report information. /// </param> /// <param name="client"> /// The ExceptionlessClient instance used for configuration. If a client is not specified, it will use /// ExceptionlessClient.Default. /// </param> /// <returns></returns> public static EventBuilder ToExceptionless(this Exception exception, ContextData enrichmentContextData = null, ExceptionlessClient client = null) { if (client == null) { client = ExceptionlessClient.Default; } if (enrichmentContextData == null) { enrichmentContextData = new ContextData(); } enrichmentContextData.SetException(exception); return(client.CreateEvent(enrichmentContextData)); }
/// <summary> /// Creates a log message event. /// </summary> /// <param name="client">The client instance.</param> /// <param name="message">The log message.</param> public static EventBuilder CreateLog(this ExceptionlessClient client, string message) { return(client.CreateEvent().SetType(Event.KnownTypes.Log).SetMessage(message)); }
/// <summary> /// Creates a session end event. /// </summary> /// <param name="client">The client instance.</param> /// <param name="sessionId">The session id.</param> public static EventBuilder CreateSessionEnd(this ExceptionlessClient client, string sessionId) { return(client.CreateEvent().SetType(Event.KnownTypes.SessionEnd).SetSessionId(sessionId)); }
/// <summary> /// Creates a resource not found event. /// </summary> /// <param name="client">The client instance.</param> /// <param name="resource">The name of the resource that was not found.</param> public static EventBuilder CreateNotFound(this ExceptionlessClient client, string resource) { return(client.CreateEvent().SetType(Event.KnownTypes.NotFound).SetSource(resource)); }
/// <summary> /// Creates a feature usage event. /// </summary> /// <param name="client">The client instance.</param> /// <param name="feature">The name of the feature that was used.</param> public static EventBuilder CreateFeatureUsage(this ExceptionlessClient client, string feature) { return(client.CreateEvent().SetType(Event.KnownTypes.FeatureUsage).SetSource(feature)); }
/// <summary> /// Submits a resource not found event. /// </summary> /// <param name="client">The client instance.</param> /// <param name="resource">The name of the resource that was not found.</param> public static void SubmitNotFound(this ExceptionlessClient client, string resource) { client.CreateEvent().SetType(Event.KnownTypes.NotFound).SetSource(resource).Submit(); }
/// <summary> /// Submits a session end event. /// </summary> /// <param name="client">The client instance.</param> /// <param name="sessionId">The session id.</param> public static void SubmitSessionEnd(this ExceptionlessClient client, string sessionId) { client.CreateEvent().SetType(Event.KnownTypes.SessionEnd).SetSessionId(sessionId).Submit(); }
/// <summary> /// Creates a session start event. /// </summary> /// <param name="client">The client instance.</param> public static EventBuilder CreateSessionStart(this ExceptionlessClient client) { return(client.CreateEvent().SetType(Event.KnownTypes.Session)); }
/// <summary> /// Submits a log message event. /// </summary> /// <param name="client">The client instance.</param> /// <param name="source">The log source.</param> /// <param name="message">The log message.</param> public static void SubmitLog(this ExceptionlessClient client, string source, string message) { client.CreateEvent().SetType(Event.KnownTypes.Log).SetSource(source).SetMessage(message).Submit(); }
/// <summary> /// Submits a feature usage event. /// </summary> /// <param name="client">The client instance.</param> /// <param name="feature">The name of the feature that was used.</param> public static void SubmitFeatureUsage(this ExceptionlessClient client, string feature) { client.CreateEvent().SetType(Event.KnownTypes.FeatureUsage).SetSource(feature).Submit(); }