Laravel 5 - change default log location, move log file outside the app

Limon Monte picture Limon Monte · Nov 20, 2015 · Viewed 20.4k times · Source

How can I change default log file location <project-name>/storage/logs/laravel.log to something like /var/logs/<project-name>/laravel.log?

Answer

Limon Monte picture Limon Monte · Dec 18, 2015

I resolved this case by using errorlog logging model and configuring webserver.

1. Configure Laravel:

In config/app.php configuration file:

'log' => 'errorlog'

Read more about Laravel log configuration: http://laravel.com/docs/5.1/errors#configuration

2. Configure webserver (in my case Nginx):

error_log    /var/log/nginx/<project_name>-error.log;