Skip to content

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.

4 participants