Skip to content

Add support for pushing custom events to the Event Log with sexy mode #1364

@jaxwilko

Description

@jaxwilko

Currently, new exceptions caught by the Winter error handler get pretty event log pages, it would be nice to support users doing so as well.

You can achieve this via:

Log::error($message, array_merge(
    (new EventLog())->getDetails(new \Exception()),
    [
        'exception' => [
            'type' => 'HttpError',
            'message' => $message,
            'code' => $response->code,
            'file' => __FILE__,
            'line' => __LINE__ - 8,
            'snippet' => explode(PHP_EOL, $snippet),
            'stringTrace' => $snippet,
            'trace' => [],
            'previous' => null
        ],
    ]
));

Which ends up looking like this:
Image

This is not really ideal, maybe we can think of something better like:

Log::prettyError($message, [
    // details...
]);

But nicer :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions