We just started integrating Timber into our project and Sentry automagically started sending Timber logs as breadcrumbs. But unlike our manual Sentry.addBreadcrumb calls, the breadcrumbs only say "Timber" they don't say the source. See image for example of what I mean. These two logs are coming from different classes. Do I have to manually tag all my Timber calls to get the class name back in the breadcrumb?
#Does the Timber integration really not add the filename to the breadcrumbs?
13 messages · Page 1 of 1 (latest)
@torn lynx any idea about this ?
Just curious - Did you try sending Logs to Sentry instead of breadcrumbs? They'd be globally searchable too then
TBH, I like just learned about the logs feature a few days ago.
Can I use the Timber integration to do that?
Frankly, I didn't even expect your guys' code to even get hooked up yet, it's happening through some automagical thing (I assume your gradle plugin).
We're woefully behind the 8ball here. I need to re-read the timber integration docs, but it started "just working" so others on the team just started wholesale changing Sentry.captureException() and Sentry.addBreadcrumb() calls over to just Timber calls
Which is kind of what I want... I'd really like to keep your SDK behind Timber's facade
I can confidently say that whatever we're doing now with Timber and Sentry, is whatever defaults you all set with the integration when you detect Timber on the classpath
We use your product, likely very basically/poorly
The timber integration should be able to send Logs to if you have the enableLogs option in your init method - it's def auto magical right now
I need our SDK team in VIE to answer your questions about the class names though
hey, classnames is something that Timber's DebugTree adds automatically, but it's not recommended in production and that's why we don't do that in our own Tree implementation.
I'd suggest you create a custom Tree which is based on SentryTimberTree but also infers the classname akin to the DebugTree. Or open an issue to request this feature for the SentryTimberTree -- we might add it behind some flag to control the behaviour
Right, because the DebugTree is tossing an exception behind the scenes to get the class name, right? So I guess the right thing to do is still use a manual tag. I can live with that.
But looking at your tree, and specifically, your addBreadcrumb() function, it's the only one of your three private methods (the others being captureEvent() and addLog() that doesn't take the tag as a parameter. I assume that if I just called Sentry.addBreadcrumb() internally somewhere, you're getting the class name? Because all of those manual calls we still have left have the Class name in the title of the breadcrumb. So I'm guessing down that path, somehow you all are setting the category prop on the breadcrumb to the class name, so I need to do similar in my custom Tree based off your tree?