|
8 | 8 | using Exceptionless.Logging;
|
9 | 9 | using Exceptionless.Models;
|
10 | 10 | using Exceptionless.Models.Data;
|
| 11 | +using Exceptionless.Plugins; |
11 | 12 | using Exceptionless.Storage;
|
12 | 13 |
|
13 | 14 | namespace Exceptionless {
|
@@ -86,11 +87,21 @@ public static string GetInstallId(this ExceptionlessConfiguration config) {
|
86 | 87 | return persistedClientData[INSTALL_ID_KEY];
|
87 | 88 | }
|
88 | 89 |
|
89 |
| - public static void UseSessions(this ExceptionlessConfiguration config, bool sendHeartbeats = true) { |
| 90 | + /// <summary> |
| 91 | + /// Automatically send session start, session heartbeats and session end events. |
| 92 | + /// </summary> |
| 93 | + /// <param name="config">Exceptionless configuration</param> |
| 94 | + /// <param name="sendHeartbeats">Controls whether heartbeat events are sent on an interval.</param> |
| 95 | + /// <param name="heartbeatInterval">The interval at which heartbeats are sent after the last sent event. The default is 30 seconds.</param> |
| 96 | + /// <param name="useSessionIdManagement">Allows you to manually control the session id. This is only recommended for single user desktop environments.</param> |
| 97 | + public static void UseSessions(this ExceptionlessConfiguration config, bool sendHeartbeats = true, TimeSpan? heartbeatInterval = null, bool useSessionIdManagement = false) { |
90 | 98 | config.SessionsEnabled = true;
|
91 | 99 |
|
| 100 | + if (useSessionIdManagement) |
| 101 | + config.AddPlugin<SessionIdManagementPlugin>(); |
| 102 | + |
92 | 103 | if (sendHeartbeats)
|
93 |
| - config.AddPlugin<HeartbeatPlugin>(); |
| 104 | + config.AddPlugin(new HeartbeatPlugin(heartbeatInterval)); |
94 | 105 | }
|
95 | 106 |
|
96 | 107 | public static InMemoryExceptionlessLog UseInMemoryLogger(this ExceptionlessConfiguration config, LogLevel minLogLevel = LogLevel.Info) {
|
|
0 commit comments