Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds ability to specify user values via NLog configuration (#336)
- Loading branch information
1 parent
385a1e4
commit dcea346
Showing
9 changed files
with
202 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,15 @@ | ||
| ||
Sentry.NLog.SentryNLogOptions.User.get -> Sentry.NLog.SentryNLogUser | ||
Sentry.NLog.SentryNLogOptions.User.set -> void | ||
Sentry.NLog.SentryNLogUser | ||
Sentry.NLog.SentryNLogUser.Email.get -> NLog.Layouts.Layout | ||
Sentry.NLog.SentryNLogUser.Email.set -> void | ||
Sentry.NLog.SentryNLogUser.Id.get -> NLog.Layouts.Layout | ||
Sentry.NLog.SentryNLogUser.Id.set -> void | ||
Sentry.NLog.SentryNLogUser.IpAddress.get -> NLog.Layouts.Layout | ||
Sentry.NLog.SentryNLogUser.IpAddress.set -> void | ||
Sentry.NLog.SentryNLogUser.Other.get -> System.Collections.Generic.IList<NLog.Targets.TargetPropertyWithContext> | ||
Sentry.NLog.SentryNLogUser.SentryNLogUser() -> void | ||
Sentry.NLog.SentryNLogUser.Username.get -> NLog.Layouts.Layout | ||
Sentry.NLog.SentryNLogUser.Username.set -> void | ||
Sentry.NLog.SentryTarget.User.get -> Sentry.NLog.SentryNLogUser | ||
Sentry.NLog.SentryTarget.User.set -> void |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using NLog.Config; | ||
using NLog.Layouts; | ||
using NLog.Targets; | ||
|
||
namespace Sentry.NLog | ||
{ | ||
/// <summary> | ||
/// A helper class used to configure Sentry user properties using NLog layouts | ||
/// </summary> | ||
public class SentryNLogUser | ||
{ | ||
/// <summary> | ||
/// A <see cref="Layout"/> used to dynamically specify the id of a user for a sentry event. | ||
/// </summary> | ||
public Layout Id { get; set; } | ||
|
||
/// <summary> | ||
/// A <see cref="Layout"/> used to dynamically specify the username of a user for a sentry event. | ||
/// </summary> | ||
public Layout Username { get; set; } | ||
|
||
/// <summary> | ||
/// A <see cref="Layout"/> used to dynamically specify the email of a user for a sentry event. | ||
/// </summary> | ||
public Layout Email { get; set; } | ||
|
||
/// <summary> | ||
/// A <see cref="Layout"/> used to dynamically specify the ip address of a user for a sentry event. | ||
/// </summary> | ||
public Layout IpAddress { get; set; } | ||
|
||
/// <summary> | ||
/// Additional information about the user | ||
/// </summary> | ||
/// <summary> | ||
/// Add any desired additional tags that will be sent with every message. | ||
/// </summary> | ||
[ArrayParameter(typeof(TargetPropertyWithContext), "other")] | ||
public IList<TargetPropertyWithContext> Other { get; } = new List<TargetPropertyWithContext>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters