|
16 | 16 | use Sentry\ExceptionDataBag; |
17 | 17 | use Sentry\ExceptionMechanism; |
18 | 18 | use Sentry\Frame; |
| 19 | +use Sentry\Logs\Log; |
| 20 | +use Sentry\Logs\LogLevel; |
19 | 21 | use Sentry\MonitorConfig; |
20 | 22 | use Sentry\MonitorSchedule; |
21 | 23 | use Sentry\Options; |
@@ -408,5 +410,35 @@ public static function serializeAsEnvelopeDataProvider(): iterable |
408 | 410 | TEXT |
409 | 411 | , |
410 | 412 | ]; |
| 413 | + |
| 414 | + $event = Event::createLogs(new EventId('fc9442f5aef34234bb22b9a615e30ccd')); |
| 415 | + $event->setLogs([ |
| 416 | + new Log(ClockMock::microtime(true), '21160e9b836d479f81611368b2aa3d2c', LogLevel::info(), 'A log message'), |
| 417 | + ]); |
| 418 | + |
| 419 | + yield [ |
| 420 | + $event, |
| 421 | + <<<TEXT |
| 422 | +{"event_id":"fc9442f5aef34234bb22b9a615e30ccd","sent_at":"2020-08-18T22:47:15Z","dsn":"http:\/\/public@example.com\/sentry\/1","sdk":{"name":"sentry.php","version":"4.11.1","packages":[{"name":"composer:sentry\/sentry","version":"4.11.1"}]}} |
| 423 | +{"type":"log","item_count":1,"content_type":"application\/vnd.sentry.items.log+json"} |
| 424 | +{"items":[{"timestamp":1597790835,"trace_id":"21160e9b836d479f81611368b2aa3d2c","level":"info","body":"A log message","attributes":[]}]} |
| 425 | +TEXT, |
| 426 | + ]; |
| 427 | + |
| 428 | + $event = Event::createEvent(new EventId('fc9442f5aef34234bb22b9a615e30ccd')); |
| 429 | + $event->setLogs([ |
| 430 | + new Log(ClockMock::microtime(true), '21160e9b836d479f81611368b2aa3d2c', LogLevel::info(), 'A log message'), |
| 431 | + ]); |
| 432 | + |
| 433 | + yield [ |
| 434 | + $event, |
| 435 | + <<<TEXT |
| 436 | +{"event_id":"fc9442f5aef34234bb22b9a615e30ccd","sent_at":"2020-08-18T22:47:15Z","dsn":"http:\/\/public@example.com\/sentry\/1","sdk":{"name":"sentry.php","version":"4.11.1","packages":[{"name":"composer:sentry\/sentry","version":"4.11.1"}]}} |
| 437 | +{"type":"event","content_type":"application\/json"} |
| 438 | +{"timestamp":1597790835,"platform":"php","sdk":{"name":"sentry.php","version":"$sdkVersion","packages":[{"name":"composer:sentry\/sentry","version":"$sdkVersion"}]}} |
| 439 | +{"type":"log","item_count":1,"content_type":"application\/vnd.sentry.items.log+json"} |
| 440 | +{"items":[{"timestamp":1597790835,"trace_id":"21160e9b836d479f81611368b2aa3d2c","level":"info","body":"A log message","attributes":[]}]} |
| 441 | +TEXT, |
| 442 | + ]; |
411 | 443 | } |
412 | 444 | } |
0 commit comments