Skip to content

feat: Add structured logging support #1159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 2, 2025

Conversation

timfish
Copy link
Collaborator

@timfish timfish commented May 26, 2025

@timfish timfish marked this pull request as ready for review May 29, 2025 13:54
@timfish timfish requested a review from AbhiPrasad May 29, 2025 13:54
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does beforeSendLog work here?

@timfish
Copy link
Collaborator Author

timfish commented May 30, 2025

How does beforeSendLog work here?

Currently, logs will go through beforeSendLog in the process they are captured.

@AbhiPrasad
Copy link
Member

So adding beforeSendLog to the main process only affects the logs captured via the main process?

Does that align with how beforeSend works?

@timfish
Copy link
Collaborator Author

timfish commented Jun 2, 2025

So adding beforeSendLog to the main process only affects the logs captured via the main process?

Yes.

For renderer events, beforeSend is called in both the renderer and main process because they are captured in both.

The issue with beforeSendLog is that it's passed a Log type whereas the main process only deals with SerializedLog from renderers. If we are to call beforeSendLog for renderer logs we'd need to convert them back to Log.

@timfish timfish merged commit 6975b54 into getsentry:master Jun 2, 2025
34 checks passed
@timfish timfish deleted the feat/structured-logging branch June 11, 2025 09:55
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.

Sentry Structured Logging for Electron
2 participants