exceptionless / Exceptionless.Net

Exceptionless clients for the .NET platform
https://exceptionless.com
Other
554 stars 142 forks source link

How to add additional data in ExceptionLess #252

Closed landonzeng closed 3 years ago

landonzeng commented 3 years ago

How to add additional data in the Event of exceptionLess, for example: UserId: 123456, so that we can troubleshoot errors faster,Thanks!

niemyjski commented 3 years ago

Here's how you set default data and tags for every event: https://exceptionless.com/docs/clients/dotnet/settings/#adding-static-extended-data-values-with-every-report

If you are using a non web app (single tenancy) keep reading:

If you want to set the default user for all events:

ExceptionlessClient.Default.Configuration.SetUserIdentity(identity, name)

If you want to take user tracking further and get session stats (e.g., how long they used a feature) you could call:

ExceptionlessClient.Default.Configuration.UseSessions(); // call before calling startup/register
ExceptionlessClient.Default.Startup(); // if using the core client or call Register() for WinForms/WPF as described in the readme
niemyjski commented 3 years ago

Please let us know if you have any questions.