dropwizard-raven icon indicating copy to clipboard operation
dropwizard-raven copied to clipboard

Allow the hostname to be specified by environment or system properties

Open tootedom opened this issue 9 years ago • 2 comments

Hi there,

We have implemented a Raven EventBuilderHelper. This allows you to optionally specify via a Environment Variable or System Property (RavenLogbackEventHostname) the value that is set as the ServerName on the log event that is sent to sentry. This overrides the default behaviour that sources the hostname from the first local interface on the server, which could provide the incorrect value (be the wrong interface). If the environment var or sys prop isn't set; the default behaviour occurs (sourcing from the first interface).

This EventBuilderHelper has the added benefit that it circumvents an issue with the default implementation that can potentially deadlock logback, as it performs logging during the Sentry Appender's .append see (issue 139)[https://github.com/getsentry/raven-java/issues/139] for more details.

thanks @joerayme + @tootedom

tootedom avatar Sep 16 '15 15:09 tootedom