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

anonymouse703's avatar

Laravel Log doesn't work.

Hello everyone I'm just making project in 5.7... When I try to use Log::info($data) I cannot see the laravel.log in the storage though theres laravel-2019-01-07.log and laravel-2019-01-07.log in my previous project in 5.6 I have only laravel.log in my storage logs.

What should I do to display all log in a file name laravel.log? I need to see the errors in stack trace.

Thank you.

0 likes
12 replies
douglasakula's avatar

@anonymouse703 - probably permissions on the storage folder preventing laravel from creating new file. Check that permissions is 0777

douglasakula's avatar

@anonymouse703 on ubuntu - I would navigate to where the folder is via terminal and type in ls -lah

On windows you can view / modify the permissions on filezilla or view the permissions via cmd as well.

It just a property of the files and folders.

anonymouse703's avatar

@JENKY - Sad to say I clear the log.. :) how can I make a new log file laravel.log so that every time I run \Log::info() it will log in laravel.log?

Vilfago's avatar

It's all managed in app/config/logging.php

default is to specify the default channel you want to use.

and below, you have some channel already defined.

If you want to log to laravel.log you have to set the default channel to single.

Or you can specify the channel when you want to log, using Log::channel('single')->info('Something happened!'); https://laravel.com/docs/5.7/logging#writing-to-specific-channels

Moreover, you can create your own channel. I usually add these ones to have log in specific file for debuging in development

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

'queue' => [
            'driver' => 'single',
            'path' => storage_path('logs/queue.log'),
            'level' => 'debug',
        ],
Vilfago's avatar

AH ok, so it's solved. Could you choose your best answer to close the thread please.

Please or to participate in this conversation.