PHPackages                             theriddleofenigma/laravel-google-chat-log - 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. theriddleofenigma/laravel-google-chat-log

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

theriddleofenigma/laravel-google-chat-log
=========================================

Send your Laravel/Lumen application logs straight to a Google Chat (Google Workspace) space via incoming webhooks.

v3.0.0(3w ago)2472.0k↓34.6%7MITPHPPHP ^8.2CI passing

Since Feb 21Pushed 3w ago3 watchersCompare

[ Source](https://github.com/theriddleofenigma/laravel-google-chat-log)[ Packagist](https://packagist.org/packages/theriddleofenigma/laravel-google-chat-log)[ Docs](https://github.com/theriddleofenigma/laravel-google-chat-log)[ Fund](https://www.buymeacoffee.com/riddleofenigma)[ RSS](/packages/theriddleofenigma-laravel-google-chat-log/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (10)Dependencies (9)Versions (15)Used By (0)

`♥ Made with  And I love `

Laravel Google Chat Log
=======================

[](#laravel-google-chat-log)

[![Tests](https://github.com/theriddleofenigma/laravel-google-chat-log/actions/workflows/tests.yml/badge.svg)](https://github.com/theriddleofenigma/laravel-google-chat-log/actions/workflows/tests.yml)[![Lint](https://github.com/theriddleofenigma/laravel-google-chat-log/actions/workflows/lint.yml/badge.svg)](https://github.com/theriddleofenigma/laravel-google-chat-log/actions/workflows/lint.yml)

Send your [Laravel](https://laravel.com)/[Lumen](https://lumen.laravel.com) application logs straight to a Google Chat space \[Google Workspace, formerly GSuite\] via incoming webhooks.

Requirements
------------

[](#requirements)

- PHP `^8.2` (Laravel 13 requires PHP `8.3+`)
- Laravel 11, 12 or 13 (`illuminate/support` `^11.0|^12.0|^13.0`)

> For Laravel 10 use `^2.x`. For Laravel 9 or lower use `^1.x`.

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

[](#installation)

```
composer require theriddleofenigma/laravel-google-chat-log
```

The package ships with Laravel package auto-discovery, so the service provider is registered for you and it automatically adds a `google-chat` logging channel. In most cases the only thing you need to do is set the webhook url:

```
LOG_GOOGLE_CHAT_WEBHOOK_URL=https://chat.googleapis.com/v1/spaces/XXXX/messages?key=...&token=...
```

Then log to the channel:

```
use Illuminate\Support\Facades\Log;

Log::channel('google-chat')->error('Something went wrong');
```

To route your default log stack through Google Chat, add `google-chat` to the `stack` channel in `config/logging.php`, or set `LOG_CHANNEL=google-chat`.

### Customising the channel

[](#customising-the-channel)

The channel is registered with sensible defaults, but anything you define in your application's `config/logging.php` always takes precedence. You can publish the channel definition to tweak it:

```
php artisan vendor:publish --tag=google-chat-log-config
```

Or define it manually in the `channels` array of `config/logging.php`:

```
'google-chat' => [
    'driver' => 'monolog',
    'handler' => \Enigma\GoogleChatHandler::class,
    'url' => env('LOG_GOOGLE_CHAT_WEBHOOK_URL'),
    'level' => env('LOG_LEVEL', 'debug'),
    'notify_users' => [
        'default' => env('LOG_GOOGLE_CHAT_NOTIFY_USER_ID_DEFAULT'),
        'emergency' => env('LOG_GOOGLE_CHAT_NOTIFY_USER_ID_EMERGENCY'),
        'alert' => env('LOG_GOOGLE_CHAT_NOTIFY_USER_ID_ALERT'),
        'critical' => env('LOG_GOOGLE_CHAT_NOTIFY_USER_ID_CRITICAL'),
        'error' => env('LOG_GOOGLE_CHAT_NOTIFY_USER_ID_ERROR'),
        'warning' => env('LOG_GOOGLE_CHAT_NOTIFY_USER_ID_WARNING'),
        'notice' => env('LOG_GOOGLE_CHAT_NOTIFY_USER_ID_NOTICE'),
        'info' => env('LOG_GOOGLE_CHAT_NOTIFY_USER_ID_INFO'),
        'debug' => env('LOG_GOOGLE_CHAT_NOTIFY_USER_ID_DEBUG'),
    ],
],
```

> **Lumen:** make sure `$app->withFacades();` is uncommented in `bootstrap/app.php`, and register `Enigma\GoogleChatLogServiceProvider`.

You can provide the eight logging levels defined in the [RFC 5424 specification](https://tools.ietf.org/html/rfc5424): `emergency`, `alert`, `critical`, `error`, `warning`, `notice`, `info`, and `debug`.

### Multiple webhook urls

[](#multiple-webhook-urls)

Set multiple Google Chat webhook urls as a comma separated value for the `LOG_GOOGLE_CHAT_WEBHOOK_URL` env variable (or as an array in the channel config) and every space receives the log.

Notifying users with `@mention`
-------------------------------

[](#notifying-users-with-mention)

Notify a specific user by setting the corresponding user id. Ids mapped under `LOG_GOOGLE_CHAT_NOTIFY_USER_ID_DEFAULT` are notified for **all** log levels:

```
LOG_GOOGLE_CHAT_NOTIFY_USER_ID_DEFAULT=1234567890
```

To find a **USER\_ID**, right-click the user icon of the person you want to notify in Google Chat and select inspect. On the `div` element find the `data-member-id` attribute — the id is the value in `data-member-id="user/human/{USER_ID}"`.

To notify everyone (`@all`), set `LOG_GOOGLE_CHAT_NOTIFY_USER_ID_DEFAULT=all`. Multiple ids can be provided as a comma separated value, and each log level can target different users via its matching `LOG_GOOGLE_CHAT_NOTIFY_USER_ID_*` env variable.

Additional custom logs
----------------------

[](#additional-custom-logs)

Append extra key-value pairs to every Google Chat message by assigning a closure to `GoogleChatHandler::$additionalLogs`. The closure receives the current `Monolog\LogRecord` and must return an array:

```
use Enigma\GoogleChatHandler;
use Monolog\LogRecord;

class AppServiceProvider extends ServiceProvider
{
    public function boot(): void
    {
        GoogleChatHandler::$additionalLogs = function (LogRecord $record) {
            return [
                'tenant' => request()->user()?->tenant->name,
                'request' => request()->fullUrl(),
            ];
        };
    }
}
```

Non-string values are JSON encoded automatically.

Testing
-------

[](#testing)

```
composer test      # run the PHPUnit suite
composer lint      # check code style with Laravel Pint
composer format    # fix code style automatically
```

Contributing
------------

[](#contributing)

Contributions are welcome — please read the [contributing guide](CONTRIBUTING.md) first. For security issues, see the [security policy](SECURITY.md).

License
-------

[](#license)

Copyright © Kumaravel

Laravel Google Chat Log is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance94

Actively maintained with recent releases

Popularity42

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 84.3% 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 ~165 days

Recently: every ~227 days

Total

13

Last Release

26d ago

Major Versions

v1.3.0 → 2.x-dev2024-01-27

v2.1.0 → v3.0.02026-07-24

PHP version history (3 changes)v1.0.0PHP ^7.3|^8.0

2.x-devPHP ^8.1

v3.0.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29883026?v=4)[Kumaravel](/maintainers/theriddleofenigma)[@theriddleofenigma](https://github.com/theriddleofenigma)

---

Top Contributors

[![theriddleofenigma](https://avatars.githubusercontent.com/u/29883026?v=4)](https://github.com/theriddleofenigma "theriddleofenigma (43 commits)")[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (6 commits)")[![dandevweb](https://avatars.githubusercontent.com/u/94933102?v=4)](https://github.com/dandevweb "dandevweb (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

error-logginggoogle-chatgsuitelaravellaravel-logslogslumenlaravellogginglumennotificationsmonologGoogle-Chatgoogle-workspace

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/theriddleofenigma-laravel-google-chat-log/health.svg)

```
[![Health](https://phpackages.com/badges/theriddleofenigma-laravel-google-chat-log/health.svg)](https://phpackages.com/packages/theriddleofenigma-laravel-google-chat-log)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.7M3.4k](/packages/craftcms-cms)[spatie/laravel-health

Monitor the health of a Laravel application

88212.7M189](/packages/spatie-laravel-health)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[illuminate/log

The Illuminate Log package.

6225.7M692](/packages/illuminate-log)[naoray/laravel-github-monolog

Log driver to store logs as github issues

10924.7k](/packages/naoray-laravel-github-monolog)

PHPackages © 2026

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