{"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