Skip to content

Add SentryLogsLogger forwarding to Sentry Structured Logs#14

Open
mSimota wants to merge 1 commit into
lvalenta:mainfrom
mSimota:feature/sentry-structured-logs
Open

Add SentryLogsLogger forwarding to Sentry Structured Logs#14
mSimota wants to merge 1 commit into
lvalenta:mainfrom
mSimota:feature/sentry-structured-logs

Conversation

@mSimota

@mSimota mSimota commented Jun 12, 2026

Copy link
Copy Markdown
  • New SentryLogsLogger LoggerService that forwards all levels to SentrySDK.logger with code.file/code.function/code.line attributes and parameter userInfo attached per log; tag userInfo goes to scope.
  • Level mapping: verbose->trace, debug->debug, info->info, warning->warn, error->error.
  • Does not start the SDK by default (composable next to SentryLogger, which owns SentrySDK.start); init(startingSDKWith:) for standalone use forces options.enableLogs = true.
  • New SentryUserIdentity helper wrapping SentrySDK.setUser so host apps do not need to link Sentry directly.
  • Implement missing removeUserInfo on SentryLogger.
  • Bump sentry-cocoa minimum to 9.0.0 (stable structured logs API).

Description

[Explain what this PR does, and why it's important.]

Changes

[List the specific changes made in this PR.]

  • [Change 1]
  • [Change 2]

Related Issue(s)

[If there is an existing issue related to this PR, include its number here.]

Checklist

  • I have tested this code on my local machine and it works as expected.
  • I have added necessary documentation and comments.
  • I have added unit tests and they all pass.
  • I have followed the project's code style guidelines.
  • I have updated the README file (if applicable).

- New SentryLogsLogger LoggerService that forwards all levels to SentrySDK.logger with code.file/code.function/code.line attributes and parameter userInfo attached per log; tag userInfo goes to scope.
- Level mapping: verbose->trace, debug->debug, info->info, warning->warn, error->error.
- Does not start the SDK by default (composable next to SentryLogger, which owns SentrySDK.start); init(startingSDKWith:) for standalone use forces options.enableLogs = true.
- New SentryUserIdentity helper wrapping SentrySDK.setUser so host apps do not need to link Sentry directly.
- Implement missing removeUserInfo on SentryLogger.
- Bump sentry-cocoa minimum to 9.0.0 (stable structured logs API).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant