Tuesday, March 14, 2017

Custom Logging package in laravel and overriding native Logging of the framework

I customized Laravel native log to store logs in mongodb, but I want to create a package to do it.

The problem is that I want to find a way to override the native logging, maybe changing Log aliase in app.php to point to my package which has been developed based on Log contract.

    'aliases' => [
    ...
             'Log' => some\custom\package::class,
    ...
    ],

Is this a good way? Is this gonna work? There's a applicaation.php class in /vendor/laravel/framework/src/illuminate/foundation folder which is registering alias of laravel native log, is this gonna overrride my config/app.php aliases?



via Amirh

Advertisement