Skip to content

Latest commit

 

History

History
30 lines (26 loc) · 812 Bytes

vscode-log-viewer-with-lbf.md

File metadata and controls

30 lines (26 loc) · 812 Bytes

Using log viewer with VS code

  1. You should have VS Code
  2. Install log viewer into VS code
  3. Open up the wordpspace file and add the log viewer settings. if this was a fresh workspace, I'd look like this
{
	"folders": [
		{
			"path": "."
		}
	],
	"settings": {
		"logViewer.watch": [
			{
				"title": "local php error logs",
				"pattern":"${workspaceFolder}/logs/php/error.log"

			}
		]
	}
}
  1. In app/public/index.php add error_log('hello world)
  2. Click the Log Viewer Icon on theleft of VS Code
  3. Click local php error logs
  4. Reload Wordpress, you should see 'hello world' in the error logs
  5. Anything more than a string will require error_log(var_export( $objToLog, true)) where $objToLog is....