Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SangminKim's avatar

Logging single vs daily in Laravel 5.7

Hello everyone, I'm trying to log things daily as my application runs but I've noticed something weird...

With laravel 5.5 or lower, it was very easy. Setting APP_LOG in env to daily was all. Then, Laravel created log files daily using names something like yyyy-mm-dd-log...

With laravel 5.6 and higher, it seems things are little different.


LOG_CHANNEL=daily

I've added the code above to my env file then cleared and cached config. However, laravel doesn't seem to create daily log files but log everything in laravel.log. So, I've opened up logging.php under config folder... then found the following code

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

        'daily' => [
            'driver' => 'daily',
            'path' => storage_path('logs/laravel.log'),
            'level' => 'debug',
            'days' => 7,
        ],

So... it seems like both single and daily are using the same laravel.log file... is this how the recent laravel supposed to log?

What should I do if I want Laravel to log things daily like before (yyyy-mm-dd format)?

Thanks.

0 likes
3 replies
Snapey's avatar
Snapey
Best Answer
Level 122

Thats how I have it, and daily files are created.

SangminKim's avatar

Sigh... a typical PEBKAC issue... I had another LOG_CHANNEL variable set to stack in the env... and config wasn't being cleared properly for some reason...

Thanks.

Please or to participate in this conversation.