I am using Laravel 5.1 and trying to set different registration logic for the development and production environment.
In my application, I use the Log facade with most of the following methods:
Log::emergency($error); Log::alert($error); Log::critical($error); Log::error($error); Log::warning($error); Log::notice($error); Log::info($error); Log::debug($error);
However, in my work environment, I would only like to log everything that is the priority of Error , Critical , Alert or Emergency and ignore requests for lower priority logs.
I could not find anything in the documentation or by studying the code (both Log facade and Monolog class).
My current thought is to create a custom wrapper around the front of the magazine, which simply checks the environment and ignores anything below 400 (Monologues for error level). Basically, I would create a threshold variable in the environment file, and everything below will simply not register in the files.
Before I do this, I wanted to ask the community if there is an existing method / configuration for what I can use so that I don't reinvent the wheel.
If not, what would be the best approach?
php logging laravel laravel-5 monolog
Yani
source share