How to Clear Log File using Command in Laravel?

Today now in this post i will show you How to Clear Log File using Command in Laravel? Some days ago I was working on my new laravel project. Then i was found one issue that too much to load my log file . When i was open and then i need to remove that data. i mean that hang my system and must need to restart my system. I was thought what will issue, but i was got it because in my laravel.log(/storage/logs/laravel.log)¬†file had need to big size of data and my text editor can’t load that and i want to clear that’s way i can see the other error.

Then I was make search on google at last i was found the solution by using command. we need to just run command in our terminal or cmd and then we can remove all data of log file.

So let’s fire the bellow command and check again.

truncate -s 0 storage/logs/laravel.log

Read Also: How to convert file extension using CloudConvert in laravel?

Thanks for read. I hope it help you. For more you can follow us on facebook

close

About Shahriar Sagor

My name is Shahriar sagor. I'm a developer. I live in Bangladesh and I love to write tutorials and tips that will help to other Developer's. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.

View all posts by Shahriar Sagor →