agorapulse / grails-sentry

A Sentry client for Grails
Apache License 2.0
12 stars 14 forks source link

Additional Data #16

Closed rblazquez closed 8 years ago

rblazquez commented 9 years ago

After read log4j and raven integration i see that i can use MDC to send information to the "Additional Data" tag. It should be as simple as:

MDC.push("key", "value") logger.error("error message")

Is this supported by grails-raven or should i use a different way to send extra data?

Thanks in advance.

benorama commented 9 years ago

You might give it a try, but since we are using raven-java (log4j) under the hood, it might work: https://github.com/getsentry/raven-java/tree/master/raven-log4j

rblazquez commented 9 years ago

I've tried with v0.5.8 and it seems not working ... what would be the correct way to send this additional data? ... note that this are no tags to filter but just extra information.

vmpj commented 8 years ago

The following works with 0.5.8:

class RavenFilters {
    def ravenClient

    def filters = {
        all(controller:'*', action:'*') {
            before = {
                Map userData = [is_authenticated: true, custom_key_2: "custom value 2"]
                ravenClient?.setUserData(userData)
            }
        }
    }
}