spotlight icon indicating copy to clipboard operation
spotlight copied to clipboard

SDK logs visible on spotlight

Open lucas-zimerman opened this issue 11 months ago • 2 comments

Spotlight is a great tool, but one thing that would help me is being able to see the SDK logs on spotlight. With this feature, I'd be able to only focus on a single UI when looking for logs (plus if it has basic search filters)

lucas-zimerman avatar Dec 17 '24 17:12 lucas-zimerman

@lucas-zimerman that is a great idea! I'll add it to the list. I see two ways to make this happen:

  1. Most of our SDK's have support for capturing console/terminal messages and we can use that in combination with debug mode in the SDK
  2. We do support custom events, so SDKs may start sending custom events to Spotlight when it is enabled.

Which one do you think is the better approach?

BYK avatar Dec 17 '24 20:12 BYK

I think option 1 works the best, it will have the console messages that will help users to see their app log and also SDK logs that help debugging the SDKs. And since we have the UI control here, there could be checkboxes to hide/show console logs/SDK logs.

lucas-zimerman avatar Dec 18 '24 11:12 lucas-zimerman

hmm @betegon implemented it but I don't see it in the top level menu

Image

HazAT avatar Jun 08 '25 22:06 HazAT

Not really! I thought SDK logs were solve in that PR as structured logs, but I was wrong. @BYK explanation on this https://github.com/getsentry/spotlight/pull/808#issuecomment-2922447067

Also, we haven't cut a release yet so even the other logs are not shown yet. Now it looks like this:

Image

I'll talk to @BYK about structure logs!

betegon avatar Jun 09 '25 15:06 betegon

Long story short: we support structured logs now but I don't exepect SDKs to send their own debug logging through that channel. If we can make that happen when Spotlight is turned on in the SDK, I think we can solve this.

BYK avatar Jun 09 '25 19:06 BYK

Hey @BYK @betegon Today if we set debug: true in Spotlight or in Sentry sdks we get console logging.

I guess we can refer to this to get those logs captured -https://docs.sentry.io/platforms/javascript/logs/#console-logging-integration

And then the sentry SDK will send the log envelopes.

Image

Shubhdeep12 avatar Jun 10 '25 00:06 Shubhdeep12

@Shubhdeep12 I'm surprised that the SDK logging does not bypass any integration we have but this is great to know. I guess it would just be a matter of us enabling console logging integration when Spotlight is turned on?

BYK avatar Jun 10 '25 10:06 BYK

Yes consolelogging integration turned on in sentry SDK and disableLogger : false in next config

Shubhdeep12 avatar Jun 10 '25 17:06 Shubhdeep12