Skip to content
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

Refactor logger option #1625

Merged
merged 1 commit into from
Nov 6, 2023
Merged

Refactor logger option #1625

merged 1 commit into from
Nov 6, 2023

Conversation

cleptric
Copy link
Member

@cleptric cleptric commented Nov 6, 2023

This changes the logger option to accept a LoggerInterface instance.
This simplifies debugging the SDK, as you can now pass in one of the provided loggers, either DebugFileLogger or DebugStdOutLogger.

Sentry\init([
    ...
    'logger' => new DebugFileLogger(filePath: ROOT . DS . 'sentry.log'),
    ...
]);
sentry/sentry: [debug] The "Sentry\Integration\RequestIntegration" integration has been installed.
sentry/sentry: [debug] The "Sentry\Integration\TransactionIntegration" integration has been installed.
sentry/sentry: [debug] The "Sentry\Integration\FrameContextifierIntegration" integration has been installed.
sentry/sentry: [debug] The "Sentry\Integration\EnvironmentIntegration" integration has been installed.
sentry/sentry: [debug] The "Sentry\Integration\ModulesIntegration" integration has been installed.
sentry/sentry: [error] Failed to send the event to Sentry. Reason: "The DSN option must be set to use the HttpClient.".

As a follow-up, we should add more logging statements across the SDK to ease debugging and provide more context on what is happening internally.

@cleptric cleptric requested a review from stayallive November 6, 2023 04:56
@cleptric cleptric self-assigned this Nov 6, 2023
@cleptric cleptric marked this pull request as ready for review November 6, 2023 05:11
@cleptric cleptric added this to the 4.0 milestone Nov 6, 2023
@cleptric cleptric merged commit bf716d8 into 4.x Nov 6, 2023
31 of 33 checks passed
@cleptric cleptric deleted the logger-option branch November 6, 2023 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants