{"id":472,"date":"2019-06-19T04:30:30","date_gmt":"2019-06-19T04:30:30","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2019\/06\/19\/enable-magento-error-log\/"},"modified":"2025-01-02T09:45:04","modified_gmt":"2025-01-02T09:45:04","slug":"enable-magento-error-log","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/enable-magento-error-log\/","title":{"rendered":"How to Enable Magento Error Log"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">It is frustrating when errors don\u2019t leave your code  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Even more, you don\u2019t know what is going wrong and where!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Been there?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Me too.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Magento, by default, does not keep a track of errors and exceptions. However, you can always&nbsp;<em><strong>enable Magento error log<\/strong><\/em>&nbsp;to debug the issues. It is a way to tell Magento to save the error logs, which can be later used to audit and solve the errors!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method to Enable Magento Error Log:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">1. <strong>Log in<\/strong>&nbsp;to admin panel<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2. Navigate to&nbsp;<strong>System &gt; Configuration &gt; Advanced &gt; Developer<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3. Enable the option of&nbsp;<strong>Log Settings<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4. <strong><strong>Save<\/strong><\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2019\/06\/1_Log-Settings.png\" alt=\"1_Log Settings\" class=\"wp-image-5775\"\/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\"><strong>Note: <\/strong>Grant the full permission, i.e., 777 to the folder \/var\/log where log files are stored.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Find the Magento Error Log File:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now that you know how to enable Magento error log file, learn how to find that file too!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The log files are located in the <strong><em>&lt;magento-folder&gt;\/var\/log\/<\/em><\/strong>&nbsp;folder.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you do not find the log files here, check if the folder is given the writing permission. If not, the web servers won&#8217;t be able to create the log files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The primary files are <em>system.log <\/em>with all PHP warnings and issues with XML files and <em>exception.log<\/em>&nbsp;with all the exceptional cases when Magento fails to handle data for any reason.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s all about the Magento error logs you need to know.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, a few key takeaways. Make sure the errors are hidden in the production mode. Do check the Apache logs as well.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are a Magento 2 store owner, the entire process becomes easy for you! Just run a single command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em>php bin\/magento config:set dev\/debug\/debug_logging<\/em>\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Keep your logs empty, your Magento site healthy, and customers happy!&nbsp; <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank You.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is frustrating when errors don\u2019t leave your code Even more, you don\u2019t know what is going wrong and where! Been there? Me too. The&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-472","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=472"}],"version-history":[{"count":1,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/472\/revisions"}],"predecessor-version":[{"id":4189,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/472\/revisions\/4189"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}