codingduck / monolog-plugin
Coding duck specific monolog logger implementation
Installs: 25
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
pkg:composer/codingduck/monolog-plugin
Requires
- php: ^7.4|^8.0
- ext-json: *
- monolog/monolog: ^2.2
- ramsey/uuid: ^4.1
README
Simple monolog plugin to use with the coding duck's logging system.
Installation
composer require codingduck/monolog-plugin
Usage
Standalone
Standalone usage without any kind of framework.
use Codingduck\Logger\CodingDuckLogger; $factory = new CodingDuckLogger; $logger = $factory($config); $logger->info("Hello world!");
Laravel / Lumen
Usage with Laravel/Lumen. Create or modify the file config/logging.php
. If already exists just add a channel.
<?php return [ 'default' => env('LOG_CHANNEL', 'codingDuck'), 'channels' => [ 'codingDuck' => [ 'driver' => 'custom', 'via' => \Codingduck\Logger\CodingDuckLogger::class, [... $config] ] ], ];
Configuration
All path are considered from the framework entry point
Project root
The project root parameter is used to convert the files in the stacktrace from an absolute to a relative path.
Example:
if projectRoot
is /etc/projects/test/
, the stacktrace goes from /etc/projects/test/App/Http/Controller/Test.php
to /App/Http/Controller/Test.php