dustinchilson / NLog.Targets.GraylogHttp

NLog target that pushes log messages to Graylog using the Http input.
Apache License 2.0
19 stars 11 forks source link

Add Exception full type as default parameter of Gelf message #178

Open prcdpr opened 3 years ago

prcdpr commented 3 years ago

In all of my projects, I keep adding the following parameter to Graylog target settings

<parameter name="exception_type" layout="${onexception:inner=${exception:format=Type}}" />

Exception type sometimes is crucial to quickly identify issue and having it as separate field allows me to do a quick filtering if it occurred previously.

Given that exception type is a very short string, could you please consider adding it as default?

Btw a couple of weeks ago I PR'ed your library to NLog targets catalog and now it's shown here: https://nlog-project.org/config/?tab=targets 😃

dustinchilson commented 3 years ago

I like the idea. I've tried to keep the target fairly unopinionated on what and how things get logged.

Possibly we should consider adding another target that is more opinionated that sets up defaults for the most common things a dev might need to see such as callsite, etc

What do you think?

prcdpr commented 3 years ago

Sounds good to me.

I think the separate target is alright, especially that you may not want to add breaking compatibility changes. Users of GraylogHttp library may have their own exception_type defined differently and I'm not sure how that would work out.

So separate target may have more information included, in my case I would like to have as much info as possible on exceptions. Otherwise the log is not that useful when it forces me to launch debugging locally in order to find the underlying cause.

But I understand that some users are OK with minimal logging particularly when they monitor services with huge traffic and can't afford keeping hundreds of gigabytes of logs.