Search code examples
ioscocoaconfigurationerror-loggingsentry

Logging to multiple Sentry projects from a single iOS application


What we do: We are building an app used to communicate with an external hardware device. The application can receive log messages from the external device. The application already logs application events to a Sentry project.

What we want to do: We want the application to pass on the logs received from the external device to a separate Sentry project, independent of anything logged by the application itself. To achieve this, we have created a new project, and configured two Client objects using the two projects' DSNs.

The issue: Events are logged to the correct project, but the breadcrumbs appears to use a shared storage for both the Client objects, so they contain events from both projects.

Is there an easy way to define separate suites/domains/folders for the two Client objects or their BreadcrumbStores?

We have tried: We're looking into subclassing SentryFileManager and passing it to a new BreadcrumbStore, but it seems unnecessarily complicated for such a trivial task.


Solution

  • Sentry 3.10+ supports logging to multiple projects