netsells / logger-php
Log formatter for Netsells logging
Installs: 41 128
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 6
Forks: 0
Open Issues: 0
Requires
- monolog/monolog: ^1.12|^2.0
- ramsey/uuid: ^3.0|^4.0
This package is auto-updated.
Last update: 2024-11-04 13:45:14 UTC
README
A log formatter for use with PHP.
At the moment, this only comes with Laravel support. It also adds a request_id to the container to allow for request tagging.
Installation and Setup
composer require netsells/logger-php
Add the following channel to your config/logging.php
file. Ensure that you set the project value. Note that you can also set the component and subComponent for more distributed web apps.
'daily_json' => [ 'driver' => 'daily', 'path' => env('LOG_PATH', storage_path('logs/laravel-json.log')), 'formatter' => Netsells\Logger\LaravelLogger::class, 'formatter_with' => [ 'project' => 'project-name', // optional - 'component' => 'core', // optional - 'subComponent' => 'php', // optional - 'environment' => env('APP_ENV'), ], 'level' => env('LOG_LEVEL', 'debug'), 'days' => 14, ],
When you are ready to use the new format, either set your LOG_CHANNEL
to daily_json
or add daily_json
to your stack channels to benefit from multiple channels.
TODO
- Add tests
- Add setup examples for monolog