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!
If you're having a space problem you can try using daily logs, it will automatically keep last X days of log (default 5). You can see it in Errors & Logging - Log Storage. Otherwise you can simply remove the storage/logs/laravel. log file or make a command to do so (like php artisane log:clear ).
By default, Laravel is configured to create a single log file for your application, and this file is stored in app/storage/logs/laravel. log .
You can see the generated log entries in storage/logs/laravel. log file.
go to vendor->laravel->framework->src->Illuminate->Log->Writer. php and then comment out all the code within function __call like below. You log will never be save.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With