{"id":145,"date":"2019-10-11T10:18:06","date_gmt":"2019-10-11T09:18:06","guid":{"rendered":"https:\/\/www.freelancewp.guide\/?p=145"},"modified":"2019-10-11T10:18:06","modified_gmt":"2019-10-11T09:18:06","slug":"show-php-debug-log-in-vs-code-terminal-window","status":"publish","type":"post","link":"https:\/\/freelancewp.guide\/show-php-debug-log-in-vs-code-terminal-window\/","title":{"rendered":"Show PHP error or debug log in VS Code terminal window"},"content":{"rendered":"\n

Monitoring your PHP error log is a great way of tracking any errors or debug information when working on your site.<\/p>\n\n\n\n

Showing the log file in the VS Code terminal window is a great way of keeping an eye on any log entries as they appear.<\/p>\n\n\n\n

The tail command can be used to show the latest log entries.<\/p>\n\n\n\n

In the example below I am showing the php_error.log file from MAMP, showing the last 100 entries, and any future entries (-f).<\/p>\n\n\n\n

tail -f -n100 \/Applications\/MAMP\/logs\/php_error.log<\/code><\/pre>\n\n\n\n
\"\"<\/figure>\n","protected":false},"excerpt":{"rendered":"

Monitoring your PHP error log is a great way of tracking any errors or debug information when working on your site. Showing the log file in the VS Code terminal window is a great way of keeping an eye on any log entries as they appear. The tail command can be used to show the […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/freelancewp.guide\/wp-json\/wp\/v2\/posts\/145"}],"collection":[{"href":"https:\/\/freelancewp.guide\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/freelancewp.guide\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/freelancewp.guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/freelancewp.guide\/wp-json\/wp\/v2\/comments?post=145"}],"version-history":[{"count":0,"href":"https:\/\/freelancewp.guide\/wp-json\/wp\/v2\/posts\/145\/revisions"}],"wp:attachment":[{"href":"https:\/\/freelancewp.guide\/wp-json\/wp\/v2\/media?parent=145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/freelancewp.guide\/wp-json\/wp\/v2\/categories?post=145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/freelancewp.guide\/wp-json\/wp\/v2\/tags?post=145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}