ThiagoBarradas / serilog-sinks-newrelic-logs

A Serilog sink that writes events to the NewRelic Logs.
https://www.nuget.org/packages/Serilog.Sinks.NewRelic.Logs
Other
31 stars 15 forks source link

Include Exception information #4

Closed andreflourenco closed 3 years ago

andreflourenco commented 3 years ago

Status

TASK

Checklist

Include

Expected behaviour

The exception information (ToString()) should be sent as a property in the New Relic payload.

{
  "application": "NewRelicLogTestSample",
  "exception": "System.ApplicationException: This is an exception raised to test the New Relic API\r\n   at Serilog.Sinks.NewRelic.Logs.Playground.NETCore31.Program.Main() ...",
  "level": "Error",
  "MachineName": "\"PC\"",
  "message": "Error whilst testing the Serilog.Sinks.NewRelic.Logs.Sample",
  "stack_trace": "   at Serilog.Sinks.NewRelic.Logs.Playground.NETCore31.Program.Main() ...",
  "ThreadId": 1,
  "timestamp": 1612292159292
}

Actual behaviour

Currently only the stack trace of the exception is sent.

{
  "application": "NewRelicLogTestSample",
  "level": "Error",
  "MachineName": "\"PC\"",
  "message": "Error whilst testing the Serilog.Sinks.NewRelic.Logs.Sample",
  "stack_trace": "   at Serilog.Sinks.NewRelic.Logs.Playground.NETCore31.Program.Main() ...",
  "ThreadId": 1,
  "timestamp": 1612291939076
}

This was obtained from the New Relic console after running the sample project. The message in the ApplicationException This is an exception raised to test the New Relic API is completely lost.

Environment

n/a

Logs / Stack trace

n/a

georgechond94 commented 3 years ago

@andreflourenco +1 There is a PR opened for it: https://github.com/ThiagoBarradas/serilog-sinks-newrelic-logs/pull/3

ThiagoBarradas commented 3 years ago

Hello, the PR was merged and new version released! Thx guys!

https://www.nuget.org/packages/Serilog.Sinks.NewRelic.Logs/1.1.0