Mubashir's avatar

Log Rotation in Laravel 4.1.*

I am using laravel 4.1. and my log file app/storage/logs/laravel.log has gotten huge in production. I have been checking documentation and some posts here on laracasts, but they are all about laravel 5 and up.

In the app/config/app.php there is no 'Logging Configuration' like there is in laravel 5.

How do I enable log rotation in laravel 4.

Can someone please help?

0 likes
4 replies
mul14's avatar
mul14
Best Answer
Level 7

You could edit app/start/global.php, and find something like this

Log::useFiles(storage_path().'/logs/laravel.log');

Change to this

Log::useDailyFiles(storage_path().'/logs/laravel.log');

For more information read https://laravel.com/docs/4.2/errors#configuration

1 like
Mubashir's avatar

Great! thanks man. can I do weekly log rotation?

Mubashir's avatar

Thanks. but isn't there a laravel call like useDailyFiles that I can use like useWeeklyFiles, that will rotate the log every week?

Please or to participate in this conversation.