You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Middleware to log server-side reportings, like CSP messages or any javascript error. More info about how collect javascript errors.
You may need also the middlewares/payload (or any other middleware with the same purpose) to parse the json of the body.
Optionally, you can provide a Psr\Http\Message\ResponseFactoryInterface as the second argument, that will be used to create the responses returned after handle the reporting. If it's not defined, Middleware\Utils\Factory will be used to detect it automatically.
The uri path where the logs will be reported. By default is /report.
// In front-end: send the error to "/log-reporting" pathnavigator.sendBeacon('/log-reporting',error);
// In back-end: configure to collect all reportings send to the same path$reporting = (newMiddlewares\ReportingLogger($logger))->path('/log-reporting')
message
The message used to save the logs. You can use the strings %{varname} to generate dinamic messages using the reporting data. For example:
$reporting = (newMiddlewares\ReportingLogger($logger))
->message('New error: "%{message}" in line %{lineNumber}, column %{colNumber}')
]);
Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.
The MIT License (MIT). Please see LICENSE for more information.