evalphobia / logrus_sentry

sentry hook for logrus
MIT License
194 stars 78 forks source link

Allow server_name to be set globally #56

Closed mightyguava closed 6 years ago

mightyguava commented 6 years ago

We use ECS so the default hostname is set to the short-sha of the docker container, which isn't particularly useful. While the server_name can already be set as part of the log entry, it doesn't particularly make sense to create another log hook to add this.

This PR adds support for a SetServerName() method on the logger, alongside SetEnvironment(), SetRelease(), etc. I didn't remove the server_name code from data.go so the change is backwards compatible, if you do want to change the server_name in a log entry.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.3%) to 83.333% when pulling 9955b9142b8f425f662391ab393e1252c7be6c72 on mightyguava:pull into 13ba9278e2adf1537fd94143a6b6a1c0dc008ac7 on evalphobia:master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.3%) to 83.333% when pulling 9955b9142b8f425f662391ab393e1252c7be6c72 on mightyguava:pull into 13ba9278e2adf1537fd94143a6b6a1c0dc008ac7 on evalphobia:master.

evalphobia commented 6 years ago

Thank you! 🍺

Note: https://github.com/evalphobia/logrus_sentry/releases/tag/v0.4.3