juniora/laravel-mattermost-logger is a Laravel package.
It currently has 2 GitHub stars and 1.294 downloads on Packagist (latest version v2.1.1).
Install it with composer require juniora/laravel-mattermost-logger.
Discover more Laravel packages by juniora
or browse all Laravel packages to compare alternatives.
Last updated
This driver allows you to send your logs to your Mattermost (open-source Slack alternative). It will send the exception stack traces and context of the log (the second argument of the logger function in Laravel).

composer require thibaud-dauce/laravel-mattermost-logger
Add the new driver in your config/logging.php:
'mattermost' => [
'driver' => 'custom',
'via' => ThibaudDauce\MattermostLogger\MattermostLogger::class,
'webhook' => env('MATTERMOST_WEBHOOK'),
],
And update your stack in config/logging.php:
'stack' => [
'driver' => 'stack',
'channels' => ['single', 'mattermost'],
],
Don't forget to put LOG_CHANNEL=single in your local and testing environments if you don't want to send logs to Mattermost during your tests.
You can put options after the driver and via keys in your config/logging.php. All options with their defaults are in the code https://gitlab.com/thibauddauce/laravel-mattermost-logger/blob/master/src/MattermostHandler.php#L14-22
url() helper to generate the full path)logger()->info('Some message', [
'context' => 'Some contex',
'an_array_of_things' => ['foo', 'bar', 'baz'],
]);
// Or
throw new Exception('An exception occured');