I have used this function in bootstrap/app.php
file
$app->configureMonologUsing(function ($monolog) {
$maxFiles = 7;
$rotatingLogHandler = (new Monolog\Handler\RotatingFileHandler(storage_path('logs/lumen.log'), $maxFiles))
->setFormatter(new Monolog\Formatter\LineFormatter(null, null, true, true));
$monolog->setHandlers([$rotatingLogHandler]);
return $monolog;
});
It is working to generate log file based on date. But I want to generate log file user wise for that every time I have to change log file path like,
storeage/logs/USERID/DATEWISELOG.log
Instead of create logfile as storeage/logs/DATEWISELOG.log
Is it possible to generate logfile
path based on user?