PHPackages                             hebrahimzadeh/laravel-mattermost-logger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. hebrahimzadeh/laravel-mattermost-logger

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

hebrahimzadeh/laravel-mattermost-logger
=======================================

1.5.0(5y ago)0121MITPHP

Since Aug 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Hebrahimzadeh/laravel-mattermost-logger)[ Packagist](https://packagist.org/packages/hebrahimzadeh/laravel-mattermost-logger)[ RSS](/packages/hebrahimzadeh-laravel-mattermost-logger/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (4)Versions (11)Used By (0)

Laravel Mattermost Logger
=========================

[](#laravel-mattermost-logger)

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).

[![example.png](https://camo.githubusercontent.com/ee3718feff2577648a79aa94eae721b1bb3a467e1db54fc607232021f3335400/68747470733a2f2f6769746c61622e636f6d2f7468696261756464617563652f6c61726176656c2d6d61747465726d6f73742d6c6f676765722f7261772f6d61737465722f6578616d706c652e706e67)](https://camo.githubusercontent.com/ee3718feff2577648a79aa94eae721b1bb3a467e1db54fc607232021f3335400/68747470733a2f2f6769746c61622e636f6d2f7468696261756464617563652f6c61726176656c2d6d61747465726d6f73742d6c6f676765722f7261772f6d61737465722f6578616d706c652e706e67)

Installation
------------

[](#installation)

```
composer require thibaud-dauce/laravel-mattermost-logger

```

Configuration
-------------

[](#configuration)

### Add the log driver

[](#add-the-log-driver)

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.

### Options availables

[](#options-availables)

You can put options after the `driver` and `via` keys in your `config/logging.php`. All options with their defaults are in the code

- **webhook** (nothing): webhook URL to your Mattermost instance
- **channel** (town-square): channel slug where the logs will be sent to
- **icon\_url** (nothing): relative URL for the icon showed in Mattermost (the package will use the `url()` helper to generate the full path)
- **username** (Laravel Logs): username showed in Mattermost
- **level** (INFO): below this level, the logs will not be sent to your Mattermost instance (by default debug logs are not sent)
- **level\_mention** (ERROR): above this level, the logs will be red in Mattermost and people will get pinged
- **mentions** (\[@here\]): array of people to ping in case of log above **level\_mention**
- **short\_field\_length** (62): context content longer than this value will be put in a long field in Mattermost (two colmun layout, see screenshot)
- **max\_attachment\_length** (6000): truncate the content below this value (Mattermost will refuse the payload otherwise)

Usage
-----

[](#usage)

```
logger()->info('Some message', [
    'context' => 'Some contex',
    'an_array_of_things' => ['foo', 'bar', 'baz'],
]);

// Or

throw new Exception('An exception occured');
```

TODO
----

[](#todo)

- Add the possibility to queue the HTTP request

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 95.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~97 days

Total

10

Last Release

1944d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/75c05a67e6f24580b5b5421cc09fef166a6d290ba79bb8efc8bbe78fd5cbe8f7?d=identicon)[hebrahimzadeh](/maintainers/hebrahimzadeh)

---

Top Contributors

[![ThibaudDauce](https://avatars.githubusercontent.com/u/1770543?v=4)](https://github.com/ThibaudDauce "ThibaudDauce (21 commits)")[![Hebrahimzadeh](https://avatars.githubusercontent.com/u/38420287?v=4)](https://github.com/Hebrahimzadeh "Hebrahimzadeh (1 commits)")

### Embed Badge

![Health badge](/badges/hebrahimzadeh-laravel-mattermost-logger/health.svg)

```
[![Health](https://phpackages.com/badges/hebrahimzadeh-laravel-mattermost-logger/health.svg)](https://phpackages.com/packages/hebrahimzadeh-laravel-mattermost-logger)
```

###  Alternatives

[illuminate/log

The Illuminate Log package.

6224.3M518](/packages/illuminate-log)[masterro/laravel-mail-viewer

Easily view in browser outgoing emails.

6392.1k](/packages/masterro-laravel-mail-viewer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
