-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AirBrake doesn't send Error()'s, only ErrorException()'s #23
Comments
Yeah, I think this should probably be changed. Presently it's checking for the existence of an Exception: But our own docs show setting a So I think we should roll with that particular method -- as it's more consistent with how the other targets work. So essentially we just have to remove the null check on the exception, and send all messages along. /cc @DonMcNamara |
Agreed |
If you remove the null check, you get a null error on the AirbrakeNotice notice = this.SharpbrakeClient.BuildNotice(logEvent.Exception); Because nLog.Error() doesn't send the exception. What I've been trying to do is just add an else or else if (logEvent.Exception == null), and build the notice with the AirbrakeError instead. |
var notice = (logEvent.Exception != null) ? SharpBrakeClient.BuildNotice(logEvent.Exception) : SharpBrakeClient.BuildNotice(); Then add an overload here Or just modify the SharpbrakeClient wrapper there so that BuildNotice does a null check on Exception |
/cc @Elindalyne ... fight it out and see who can fix it first! ;0 |
It looks like I'm going to have to make a few changes to the AirBrakeNoticeBuilder to allow messages to be sent without exceptions. Is it acceptable to just send the formatted message and leave the Backtrace, ClassName and Catching Method empty? |
Well.. I would just check to see if we can fulfill those pieces, and pass along as much info as possible.... if they're not there, they're not there. Simple null checks on LogEventInfo properties should be sufficient to determine that. But yeah, feel free to mod @DonMcNamara code in the AirBrakeNoticeBuilder to accomplish that goal.... try not to mod the SharpBrake code where possible. |
Currently if you set a logger rule for "Error" as exampled below, and you use nLog.Error() instead of nLog.ErrorException(), Airbrake will not send an error report.
logger name="*" minlevel="Error" writeTo="airBrakeTarget"
Can we change this to allow either method to send the error?
Edit: Formatting
The text was updated successfully, but these errors were encountered: