Laravel:prepend new log to log file

700 views Asked by At

I'm looking for a way to prepend (instead of append) new logs to the log file. The problem is for the big logfile, I should scroll a lot to see new logs.

1

There are 1 answers

0
Tom On

First what you do is add a entry in config/logging.php like this:

'newLog' => [
        'driver' => 'single',
        'path' => storage_path('logs/newLog.log'),
        'level' => env('LOG_LEVEL', 'debug'),
    ],

Understand the Log level and driver system of laravel here.

I hope I could help you.