gini / dropwizard-gelf

Addon bundle for Dropwizard to support logging to a GELF-enabled server like Graylog or logstash
http://developer.gini.net/dropwizard-gelf/1.3.0-1/
Apache License 2.0
52 stars 21 forks source link

More advanced filtering of messages in GelfLoggingFilter #25

Open madmuffin1 opened 7 years ago

madmuffin1 commented 7 years ago

Hi there,

we're currently using the GelfLoggingFilter to log access requests. Since our loadbalancers send HTTP pings to a special endpoint, this creates a lot of noise, that we don't need in our logs.

I would love to extend the current GelfLoggingFilter implementation by adding an optional filtering parameter to the GelfLoggingFilter constructor that will be called in the logRequest method, when we have access to both the response and the request and drop such (matching an url and response code 200) access messages.

To make this as extensible as possible, I would suggest the usage of a functional interface that receives all the parameters that the receives the last four parameters that the logRequest method gets.

Would you accept such an addition? If so, I will prepare a MR.

Thanks

joschi commented 7 years ago

@madmuffin1 Sure, we can give it a go. Looking forward to your pull request!