https://github.com/netsells/netsells-logger-php
https://github.com/netsells/netsells-logger-php
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/netsells/netsells-logger-php
- Owner: netsells
- Created: 2020-01-05T17:56:10.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-08-04T08:16:28.000Z (almost 3 years ago)
- Last Synced: 2025-03-06T15:40:55.524Z (2 months ago)
- Language: PHP
- Size: 22.5 KB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Netsells Logger - PHP
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
```bash
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.
```php
'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