File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,26 +30,26 @@ The Sentry SDK team is happy to announce the immediate availability of Sentry PH
3030 use Monolog\Logger;
3131 use Sentry\Monolog\LogsHandler;
3232 use Sentry\Logs\LogLevel;
33-
33+
3434 // Initialize Sentry SDK first (make sure 'enable_logs' is set to true)
3535 \Sentry\init([
3636 'dsn' => '__YOUR_DSN__',
3737 'enable_logs' => true,
3838 ]);
39-
39+
4040 // Create a Monolog logger
4141 $logger = new Logger('my-app');
42-
42+
4343 // Add the Sentry logs handler
4444 // Optional: specify minimum log level (defaults to LogLevel::debug())
4545 $handler = new LogsHandler(LogLevel::info());
4646 $logger->pushHandler($handler);
47-
47+
4848 // Now your logs will be sent to Sentry
4949 $logger->info('User logged in', ['user_id' => 123]);
5050 $logger->error('Payment failed', ['order_id' => 456]);
5151 ```
52-
52+
5353 Note: The handler will not collect logs for exceptions (they should be handled separately via ` captureException ` ).
5454
5555### Bug Fixes
You can’t perform that action at this time.
0 commit comments