File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed 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
30
30
use Monolog\Logger;
31
31
use Sentry\Monolog\LogsHandler;
32
32
use Sentry\Logs\LogLevel;
33
-
33
+
34
34
// Initialize Sentry SDK first (make sure 'enable_logs' is set to true)
35
35
\Sentry\init([
36
36
'dsn' => '__YOUR_DSN__',
37
37
'enable_logs' => true,
38
38
]);
39
-
39
+
40
40
// Create a Monolog logger
41
41
$logger = new Logger('my-app');
42
-
42
+
43
43
// Add the Sentry logs handler
44
44
// Optional: specify minimum log level (defaults to LogLevel::debug())
45
45
$handler = new LogsHandler(LogLevel::info());
46
46
$logger->pushHandler($handler);
47
-
47
+
48
48
// Now your logs will be sent to Sentry
49
49
$logger->info('User logged in', ['user_id' => 123]);
50
50
$logger->error('Payment failed', ['order_id' => 456]);
51
51
```
52
-
52
+
53
53
Note: The handler will not collect logs for exceptions (they should be handled separately via ` captureException ` ).
54
54
55
55
### Bug Fixes
You can’t perform that action at this time.
0 commit comments