Laravel not creating log file.

23,677

Solution 1

The problem was permissions.
User permissions for the www-var user in the ../app/storage
And MySQL settings: Creating a user corresponding to what is set in the app/config/database.php

'mysql' => array(
            'driver'    => 'mysql',
            'host'      => 'your host',
            'database'  => 'your db',
            'username'  => 'your user',
            'password'  => 'your pass',
           ),

Solution 2

By default app/storage is the location for log files, storage folder is configured in bootstrap/paths.php

    'storage' => __DIR__.'/../app/storage',

Also be sure that this folder is writable by the web server.

Share:
23,677

Related videos on Youtube

kotoko
Author by

kotoko

Updated on March 19, 2020

Comments

  • kotoko
    kotoko about 4 years

    I'm learning Laravel 4.0 to develop a webserver.
    I'm using a LAMP stack (Apache 2, php 5.5).
    I can't find the log file where Log::error() calls writes to.
    As far as I know it's supposed to be to app/storage/logs/log-cli-.txt but there are no files there.

    Here is the code:

    app/commands/MsgCommand.php
    public function fire(){
       Log::error('messages - log');
    }
    

    It's called from artisan:

    app/start/artisan.php
    Artisan::add(new MsgCommand());
    

    Am I looking in the right place?
    How can I check that this is indeed the right folder (i.e. where is it configured)? To check for faulty installation or setup.

    Thanks to marcanuy, I am now sure it is writing to app/storage/logs.
    Also I found out it writes fine if I call the command through artisan. Running on apache 2 nothing happens though. I'm starting to think I set up the command wrong.

  • kotoko
    kotoko about 10 years
    Thanks, I see it and it has the default path. I have writing permission.