/laravel-logpond

Primary LanguagePHPMIT LicenseMIT

Log Pond Laravel Logging Package

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package provides a logging channel for Laravel that sends logs to the Log Pond logging service.

Alternatively, you may self-host the Log Pond service. More details on that in the future.

Installation

You can install the package via composer:

composer require chrisreedio/log-pond-laravel

Add the following logging channel to your config/logging.php file:

'channels' => [
    // ... Other channels
    'log-pond' => [
        'driver' => 'monolog',
        'level' => env('LOG_LEVEL', 'debug'),
        'handler' => ChrisReedIO\LogPond\Handlers\LogPondHandler::class,
        'with' => [
            'host' => env('LOG_POND_HOST'),
            'secret' => env('LOG_POND_SECRET'),
        ],
    ],
    // ... Other channels
],

Once the log-pond channel is added, you may now add it to the stack channel list like so:

'channels' => [
    'stack' => [
        'driver' => 'stack',
        'channels' => ['single', 'log-pond'],
    ],
    // ... Other channels
],

Usage

use Illuminate\Support\Facades\Log;
Log::critical('A critical error occurred!', ['context' => 'data']);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.