phplaravel-4

In PHP's Laravel, how do I clear laravel.log?


I'm new to Laravel and PHP in general, and I'm trying to clear my errorLog. The current errorlog that I'm using is Laravel's laravel.log file that is in /app/storage/logs.

Is there an easy way to clear the laravel.log file? Is it safe to delete it and it'll rebuild when needed?

I'm using the latest version of Ubuntu. Thanks!


Solution

  • Echoing an empty string to it would work, like this :

    echo "" > storage/logs/laravel.log
    

    The most efficient would be to truncate it to a size of zero :

    truncate -s 0 /app/storage/logs/laravel.log