keerill/laravel-json-formatter

JsonFormatter for Laravel Octane

v1.1.0 2024-01-22 22:53 UTC

This package is auto-updated.

Last update: 2024-04-22 23:15:38 UTC


README

Latest Version on Packagist Total Downloads

This package allows you to format JSON logs for Laravel Octane RoadRunner server.

Installation

You can install the package via composer:

composer require keerill/laravel-json-formatter

You can publish and run the migrations with:

Usage

Environment

LOG_CHANNEL=stderr
LOG_STDERR_FORMATTER="\\Keerill\\LaravelJsonFormatter\\LaravelJsonFormatter"

Config

// config/logging.php
return [
    'channels' => [
        'stderr' => [
            'driver' => 'monolog',
            'handler' => StreamHandler::class,
            'formatter' => Keerill\LaravelJsonFormatter\LaravelJsonFormatter::class,
            'with' => [
                'stream' => 'php://stderr',
            ],
        ],
    ],
]

License

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