php - Configuring log rotate in Lumen 5.2 -
i tried configure log rotation on lumen i'm stuck. know how laravel, (one more time) i'm lost lumen.
i tried add in app/bootstrap.php
, because read somewhere:
$app->configuremonologusing(function(monolog\logger $monolog) use ($app) { $monolog->pushhandler( new \monolog\handler\rotatingfilehandler($app->storagepath().'/logs/lumen.log', 5) ); });
and can view error:
fatal error: uncaught error: call member function error() on null in /x/vendor/laravel/lumen-framework/src/exceptions/handler.php:36 stack trace: #0 /x/app/exceptions/handler.php(36): laravel\lumen\exceptions\handler->report(object(symfony\component\debug\exception\fatalthrowableerror)) #1 /x/vendor/laravel/lumen-framework/src/concerns/registersexceptionhandlers.php(123): app\exceptions\handler->report(object(symfony\component\debug\exception\fatalthrowableerror)) #2 /x/vendor/laravel/lumen-framework/src/concerns/registersexceptionhandlers.php(51): laravel\lumen\application->handleuncaughtexception(object(symfony\component\debug\exception\fatalthrowableerror)) #3 [internal function]: laravel\lumen\application->laravel\lumen\concerns\{closure}(object(error)) #4 {main} thrown in /x/vendor/laravel/lumen-framework/src/exceptions/handler.php on line 36
i don't understand mean, , should do.
does has succeeded in rotating log in lumen 5.2?
you forget returning object, should be:
$app->configuremonologusing(function(monolog\logger $monolog) use ($app) { return $monolog->pushhandler( new \monolog\handler\rotatingfilehandler($app->storagepath().'/logs/lumen.log', 5) ); });
Comments
Post a Comment