corentinaltepe / nlog.loki

NLog target for Loki using an HTTP client
BSD 3-Clause "New" or "Revised" License
22 stars 7 forks source link

Keep only stacktrace in stacktrace field #113

Closed alexandersav14 closed 6 months ago

alexandersav14 commented 7 months ago

Instead of keeping full exception

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (3d2bb49) 80.35% compared to head (fcf07d6) 75.89%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #113 +/- ## ========================================== - Coverage 80.35% 75.89% -4.47% ========================================== Files 12 12 Lines 336 336 Branches 0 44 +44 ========================================== - Hits 270 255 -15 Misses 66 66 - Partials 0 15 +15 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

snakefoot commented 6 months ago

The "full" exception only includes the additional exception-type and exception-message. I recommend Exception.ToString over NLog custom formatting of Exception-StackTrace.

Again this is just an example configuration, one is free to divert from the recommendation.

corentinaltepe commented 6 months ago

Hi, thank you both for your contribution. Provided @snakefoot recommends keeping tostring, and that the readme is only a configuration recommendation that is not directly related to the NLog.Targets.Loki package, I will not merge the change.

ADSavchenko commented 6 months ago

Hi, I just wanted to mention that exception-type and exception-message that included in the "full" exception, are already present in type and message fields respectively. So there is no reason to keep them in the stacktrace field.