Skip to content

Add Sentry logs #1813

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 49 commits into from
May 22, 2025
Merged

Add Sentry logs #1813

merged 49 commits into from
May 22, 2025

Conversation

cleptric
Copy link
Member

@cleptric cleptric commented Mar 21, 2025

This adds initial support for logs in the PHP SDK.

use function Sentry\logger;

logger()->info('Hello, %!', ['PHP'], ['an_attribute' => 42]);
logger()->flush();

ToDos:

See: https://develop.sentry.dev/sdk/telemetry/logs/

  • Create a proper attributes API
  • Support for string templates
  • Support for extra attributes
  • Support usage with the agent
  • Add beforeSendLog
  • Log any logger() calls to the configured logger. (aka, debug: true).
  • Add a default server.address attribute to each log entry
  • Tests

@cleptric cleptric self-assigned this Mar 21, 2025
@stayallive stayallive marked this pull request as ready for review May 22, 2025 11:49
Copy link
Collaborator

@stayallive stayallive left a comment

Choose a reason for hiding this comment

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

🚢

@cleptric cleptric merged commit bd09259 into master May 22, 2025
38 checks passed
@cleptric cleptric deleted the logs branch May 22, 2025 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants