Skip to content

Additional data with Monolog #1014

@enumag

Description

@enumag

Some of my calls to Monolog contain additional data in the $context array. I need to get some of these data into the \Sentry\Event object. I want to use an event processor for that since it gets both the Event instance and the original $payload array (see #1010).

The issue is that the data I need don't make it into the $payload array at the moment. The Monolog Handler only copies the exception but the rest of $record['context'] is thrown away:

if (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Throwable) {
$payload['exception'] = $record['context']['exception'];
}

Do I have to write my own Monolog Handler for this or can we improve the existing one in this library to pass the data into the payload?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions