Skip to content

Commit 7e40695

Browse files
committed
Don't set the environment user when it doesn't make sense (web & service apps).
1 parent 7bf99f6 commit 7e40695

File tree

6 files changed

+7
-5
lines changed

6 files changed

+7
-5
lines changed

Source/Extras/Extensions/ExceptionlessClientExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public static void Startup(this ExceptionlessClient client, AppDomain appDomain
2626
client.Configuration.UseErrorPlugin();
2727
client.Configuration.UseTraceLogEntriesPlugin();
2828
client.Configuration.AddPlugin<VersionPlugin>();
29-
client.Configuration.AddPlugin<PrivateInformationPlugin>();
3029

3130
client.RegisterAppDomainUnhandledExceptionHandler(appDomain);
3231
client.RegisterTaskSchedulerUnobservedTaskExceptionHandler();

Source/Extras/Plugins/15_PrivateInformationPlugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Exceptionless.Plugins {
44
[Priority(15)]
5-
public class PrivateInformationPlugin : IEventPlugin {
5+
public class SetEnvironmentUserPlugin : IEventPlugin {
66
public void Run(EventPluginContext context) {
77
if (!context.Client.Configuration.IncludePrivateInformation)
88
return;

Source/Platforms/Console/ExceptionlessExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ public static class ExceptionlessExtensions {
1111
/// </summary>
1212
/// <param name="client">The ExceptionlessClient.</param>
1313
public static void Register(this ExceptionlessClient client) {
14-
client.Configuration.UseSessions();
1514
client.Startup();
1615
client.SubmitSessionStart();
1716

Source/Platforms/Windows/ExceptionlessWindowsExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Exceptionless.Dependency;
44
using Exceptionless.Dialogs;
55
using Exceptionless.Logging;
6+
using Exceptionless.Plugins;
67
using Exceptionless.Windows.Extensions;
78

89
namespace Exceptionless {
@@ -16,6 +17,7 @@ public static class ExceptionlessWindowsExtensions {
1617
/// <param name="showDialog">Controls whether a dialog is shown when an unhandled exception occurs.</param>
1718
public static void Register(this ExceptionlessClient client, bool showDialog = true) {
1819
client.Configuration.UseSessions();
20+
client.Configuration.AddPlugin<SetEnvironmentUserPlugin>();
1921
client.Startup();
2022
client.SubmitSessionStart();
2123
client.RegisterApplicationThreadExceptionHandler();

Source/Platforms/Wpf/ExceptionlessWpfExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using Exceptionless.Dependency;
55
using Exceptionless.Dialogs;
66
using Exceptionless.Logging;
7+
using Exceptionless.Plugins;
78
using Exceptionless.Wpf.Extensions;
89

910
namespace Exceptionless {
@@ -17,6 +18,7 @@ public static class ExceptionlessWpfExtensions {
1718
/// <param name="showDialog">Controls whether a dialog is shown when an unhandled exception occurs.</param>
1819
public static void Register(this ExceptionlessClient client, bool showDialog = true) {
1920
client.Configuration.UseSessions();
21+
client.Configuration.AddPlugin<SetEnvironmentUserPlugin>();
2022
client.Startup();
2123
client.SubmitSessionStart();
2224
client.RegisterApplicationThreadExceptionHandler();

Source/Tests/Plugins/PluginTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public void ShouldUseReferenceIds() {
169169
[Fact]
170170
public void PrivateInformation_WillSetIdentity() {
171171
var client = new ExceptionlessClient();
172-
var plugin = new PrivateInformationPlugin();
172+
var plugin = new SetEnvironmentUserPlugin();
173173

174174
var context = new EventPluginContext(client, new Event { Type = Event.KnownTypes.Log, Message = "test" });
175175
plugin.Run(context);
@@ -181,7 +181,7 @@ public void PrivateInformation_WillSetIdentity() {
181181
[Fact]
182182
public void PrivateInformation_WillNotUpdateIdentity() {
183183
var client = new ExceptionlessClient();
184-
var plugin = new PrivateInformationPlugin();
184+
var plugin = new SetEnvironmentUserPlugin();
185185

186186
var ev = new Event { Type = Event.KnownTypes.Log, Message = "test" };
187187
ev.SetUserIdentity(null, "Blake");

0 commit comments

Comments
 (0)