{"id":14527,"date":"2020-06-08T07:00:21","date_gmt":"2020-06-08T07:00:21","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=14527"},"modified":"2021-11-05T10:33:39","modified_gmt":"2021-11-05T10:33:39","slug":"in-laravel-how-can-i-clear-laravel-log","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/in-laravel-how-can-i-clear-laravel-log\/","title":{"rendered":"In Laravel, how can I clear laravel.log?"},"content":{"rendered":"\n<p>In my Laravel project i want to clear my <strong>laravel.log<\/strong> file but i have no idea how to do it. so i found a solution on it. <\/p>\n\n\n\n<p>First of all you have to navigate to your project <strong>storage\/logs<\/strong> location then you have to type vim laravel.log command to enter in the <strong>laravel.log<\/strong> file.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Solution: <\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>vim laravel.log<\/li><li>Then type ggdG<\/li><li>then :wq save and quit<\/li><\/ul>\n\n\n\n<p><strong>Notes:<\/strong> <strong>gg<\/strong> &#8211; moves cursor to first line<br><strong>d <\/strong>&#8211; delete<br><strong>G<\/strong> &#8211; to the end of the file<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"521\" height=\"241\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/laravel-storage-logs-location.jpg\" alt=\"\" class=\"wp-image-14530\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/laravel-storage-logs-location.jpg 521w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/06\/laravel-storage-logs-location-300x139.jpg 300w\" sizes=\"auto, (max-width: 521px) 100vw, 521px\" \/><figcaption><em>logs location<\/em><\/figcaption><\/figure><\/div>\n\n\n\n<p>Resources : <a href=\"https:\/\/stackoverflow.com\/questions\/28127495\/in-phps-laravel-how-do-i-clear-laravel-log\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/stackoverflow.com\/questions\/28127495\/in-phps-laravel-how-do-i-clear-laravel-log<\/a><\/p>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_46558\"><figure class=\"wp-block-embed wp-block-embed-youtube is-type-video is-provider-youtube epyt-figure\"><div class=\"wp-block-embed__wrapper\"><iframe loading=\"lazy\"  id=\"_ytid_93583\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_46558\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><\/div><\/figure><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>In my Laravel project i want to clear my laravel.log file but i have no idea how to do it. so i found a solution on it. First of all you have to navigate to your project storage\/logs location then you have to type vim laravel.log command to enter in the laravel.log file. Solution: vim&#8230;<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[5201],"tags":[258,5203,603],"class_list":["post-14527","post","type-post","status-publish","format-standard","hentry","category-laravel","tag-error","tag-laravel","tag-logs"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14527","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=14527"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14527\/revisions"}],"predecessor-version":[{"id":24784,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14527\/revisions\/24784"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=14527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=14527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=14527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}