{"id":44473,"date":"2022-11-08T15:41:46","date_gmt":"2022-11-08T15:41:46","guid":{"rendered":"https:\/\/keys.support\/?post_type=docs&#038;p=44473"},"modified":"2022-11-08T15:51:00","modified_gmt":"2022-11-08T15:51:00","password":"","slug":"how-to-check-magento-2-logs","status":"publish","type":"docs","link":"https:\/\/keys.express\/support\/en\/documentation\/how-to-check-magento-2-logs\/","title":{"rendered":"How to check Magento 2 logs"},"content":{"rendered":"\n<p>There are 3 main logs that Magento 2 writes depending on the type of error: <strong>debug.log<\/strong>, <strong>exception.log<\/strong>, and <strong>system.log<\/strong><\/p>\n\n\n\n<p>Exception errors are being written to either <strong>debug.log<\/strong> or <strong>exception.log<\/strong> depending on the configuration also from the backend.<\/p>\n\n\n\n<p>Logs can be found in &lt;install_directory&gt;\/var\/log\/ directory<\/p>\n\n\n\n<p>Because a log file is a long list of logs, sometimes it is hard to read\/check the latest lines of logs if you are viewing the log file. The best way to print only the last few number of lines of logs is to use the terminal and use the tail command. In this example, I&#8217;m gonna print the last 200 lines of the debug.log file<br><br>1. cd to the root M2 installation:  <code>cd ~\/keys.express\/<\/code><\/p>\n\n\n\n<p>2. Using the tail command: <code>tail -f -n200 var\/log\/debug.log<\/code> then press enter.<\/p>\n\n\n\n<p>3. While the terminal is actively printing the last 200 lines of the <strong>debug.log<\/strong> file, you can do a test transaction from the storefront or backend of Magento.<\/p>\n\n\n\n<p>4. To exit from the tail command, you can press Ctrl+C for windows and Linux or Command+C for Mac.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are 3 main logs that Magento 2 writes depending on the type of error: debug.log, exception.log, and system.log Exception errors are being written to either debug.log or exception.log depending on the configuration also from the backend. Logs can be found in &lt;install_directory&gt;\/var\/log\/ directory Because a log file is a long list of logs, sometimes [&hellip;]<\/p>\n","protected":false},"author":81,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"doc_category":[262],"doc_tag":[580],"knowledge_base":[108],"class_list":["post-44473","docs","type-docs","status-publish","hentry","doc_category-magento","doc_tag-magento","knowledge_base-information-technology"],"acf":[],"year_month":"2026-06","word_count":189,"total_views":"492","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"admin","author_nicename":"dev_staedeli","author_url":"https:\/\/keys.express\/support\/en\/author\/dev_staedeli\/"},"doc_category_info":[{"term_name":"Magento Developers","term_url":"https:\/\/keys.express\/support\/en\/docs\/information-technology\/magento\/"}],"doc_tag_info":[{"term_name":"magento","term_url":"https:\/\/keys.express\/support\/en\/docs-tag\/magento\/"}],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to check Magento 2 logs - Keys Support<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/keys.express\/support\/en\/documentation\/how-to-check-magento-2-logs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to check Magento 2 logs - Keys Support\" \/>\n<meta property=\"og:description\" content=\"There are 3 main logs that Magento 2 writes depending on the type of error: debug.log, exception.log, and system.log Exception errors are being written to either debug.log or exception.log depending on the configuration also from the backend. Logs can be found in &lt;install_directory&gt;\/var\/log\/ directory Because a log file is a long list of logs, sometimes [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/keys.express\/support\/en\/documentation\/how-to-check-magento-2-logs\/\" \/>\n<meta property=\"og:site_name\" content=\"Keys Support\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-08T15:51:00+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/keys.express\\\/support\\\/en\\\/documentation\\\/how-to-check-magento-2-logs\\\/\",\"url\":\"https:\\\/\\\/keys.express\\\/support\\\/en\\\/documentation\\\/how-to-check-magento-2-logs\\\/\",\"name\":\"How to check Magento 2 logs - Keys Support\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/keys.express\\\/support\\\/en\\\/#website\"},\"datePublished\":\"2022-11-08T15:41:46+00:00\",\"dateModified\":\"2022-11-08T15:51:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/keys.express\\\/support\\\/en\\\/documentation\\\/how-to-check-magento-2-logs\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/keys.express\\\/support\\\/en\\\/documentation\\\/how-to-check-magento-2-logs\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/keys.express\\\/support\\\/en\\\/documentation\\\/how-to-check-magento-2-logs\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/keys.express\\\/support\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Docs\",\"item\":\"https:\\\/\\\/keys.express\\\/support\\\/de\\\/docs\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to check Magento 2 logs\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/keys.express\\\/support\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/keys.express\\\/support\\\/en\\\/\",\"name\":\"Keys Support\",\"description\":\"Keys Support and It Works!\",\"publisher\":{\"@id\":\"https:\\\/\\\/keys.express\\\/support\\\/en\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/keys.express\\\/support\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/keys.express\\\/support\\\/en\\\/#organization\",\"name\":\"Keys Support\",\"url\":\"https:\\\/\\\/keys.express\\\/support\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/keys.express\\\/support\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/keys.express\\\/support\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/KE-Logo-en.svg\",\"contentUrl\":\"https:\\\/\\\/keys.express\\\/support\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/KE-Logo-en.svg\",\"width\":248,\"height\":92,\"caption\":\"Keys Support\"},\"image\":{\"@id\":\"https:\\\/\\\/keys.express\\\/support\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to check Magento 2 logs - Keys Support","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/keys.express\/support\/en\/documentation\/how-to-check-magento-2-logs\/","og_locale":"en_US","og_type":"article","og_title":"How to check Magento 2 logs - Keys Support","og_description":"There are 3 main logs that Magento 2 writes depending on the type of error: debug.log, exception.log, and system.log Exception errors are being written to either debug.log or exception.log depending on the configuration also from the backend. Logs can be found in &lt;install_directory&gt;\/var\/log\/ directory Because a log file is a long list of logs, sometimes [&hellip;]","og_url":"https:\/\/keys.express\/support\/en\/documentation\/how-to-check-magento-2-logs\/","og_site_name":"Keys Support","article_modified_time":"2022-11-08T15:51:00+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/keys.express\/support\/en\/documentation\/how-to-check-magento-2-logs\/","url":"https:\/\/keys.express\/support\/en\/documentation\/how-to-check-magento-2-logs\/","name":"How to check Magento 2 logs - Keys Support","isPartOf":{"@id":"https:\/\/keys.express\/support\/en\/#website"},"datePublished":"2022-11-08T15:41:46+00:00","dateModified":"2022-11-08T15:51:00+00:00","breadcrumb":{"@id":"https:\/\/keys.express\/support\/en\/documentation\/how-to-check-magento-2-logs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/keys.express\/support\/en\/documentation\/how-to-check-magento-2-logs\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/keys.express\/support\/en\/documentation\/how-to-check-magento-2-logs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/keys.express\/support\/en\/"},{"@type":"ListItem","position":2,"name":"Docs","item":"https:\/\/keys.express\/support\/de\/docs\/"},{"@type":"ListItem","position":3,"name":"How to check Magento 2 logs"}]},{"@type":"WebSite","@id":"https:\/\/keys.express\/support\/en\/#website","url":"https:\/\/keys.express\/support\/en\/","name":"Keys Support","description":"Keys Support and It Works!","publisher":{"@id":"https:\/\/keys.express\/support\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/keys.express\/support\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/keys.express\/support\/en\/#organization","name":"Keys Support","url":"https:\/\/keys.express\/support\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/keys.express\/support\/en\/#\/schema\/logo\/image\/","url":"https:\/\/keys.express\/support\/wp-content\/uploads\/2025\/02\/KE-Logo-en.svg","contentUrl":"https:\/\/keys.express\/support\/wp-content\/uploads\/2025\/02\/KE-Logo-en.svg","width":248,"height":92,"caption":"Keys Support"},"image":{"@id":"https:\/\/keys.express\/support\/en\/#\/schema\/logo\/image\/"}}]}},"knowledge_base_info":[{"term_name":"Information Technology","term_url":"https:\/\/keys.express\/support\/en\/docs\/information-technology\/","term_slug":"information-technology"}],"knowledge_base_slug":["information-technology"],"_links":{"self":[{"href":"https:\/\/keys.express\/support\/en\/wp-json\/wp\/v2\/docs\/44473","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/keys.express\/support\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/keys.express\/support\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/keys.express\/support\/en\/wp-json\/wp\/v2\/users\/81"}],"replies":[{"embeddable":true,"href":"https:\/\/keys.express\/support\/en\/wp-json\/wp\/v2\/comments?post=44473"}],"version-history":[{"count":2,"href":"https:\/\/keys.express\/support\/en\/wp-json\/wp\/v2\/docs\/44473\/revisions"}],"predecessor-version":[{"id":44475,"href":"https:\/\/keys.express\/support\/en\/wp-json\/wp\/v2\/docs\/44473\/revisions\/44475"}],"wp:attachment":[{"href":"https:\/\/keys.express\/support\/en\/wp-json\/wp\/v2\/media?parent=44473"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/keys.express\/support\/en\/wp-json\/wp\/v2\/doc_category?post=44473"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/keys.express\/support\/en\/wp-json\/wp\/v2\/doc_tag?post=44473"},{"taxonomy":"knowledge_base","embeddable":true,"href":"https:\/\/keys.express\/support\/en\/wp-json\/wp\/v2\/knowledge_base?post=44473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}