/// <summary> /// Automatically send session start, session heartbeats and session end events. /// </summary> /// <param name="config">Exceptionless configuration</param> /// <param name="sendHeartbeats">Controls whether heartbeat events are sent on an interval.</param> /// <param name="heartbeatInterval">The interval at which heartbeats are sent after the last sent event. The default is 1 minutes.</param> /// <param name="useSessionIdManagement">Allows you to manually control the session id. This is only recommended for single user desktop environments.</param> public static void UseSessions(this ExceptionlessConfiguration config, bool sendHeartbeats = true, TimeSpan?heartbeatInterval = null, bool useSessionIdManagement = false) { config.SessionsEnabled = true; if (useSessionIdManagement) { config.AddPlugin <SessionIdManagementPlugin>(); } if (sendHeartbeats) { config.AddPlugin(new HeartbeatPlugin(heartbeatInterval)); } else { config.RemovePlugin <HeartbeatPlugin>(); } }
/// <summary> /// Reads the Exceptionless configuration from the app.config or web.config file. /// </summary> /// <param name="config">The configuration object you want to apply the attribute settings to.</param> public static void UseErrorPlugin(this ExceptionlessConfiguration config) { config.RemovePlugin <SimpleErrorPlugin>(); config.AddPlugin <Plugins.ErrorPlugin>(); }