Where are Visual Studio Code log files?

2020-08-10 07:37发布

问题:

My VS Code frequently shows an error, something like "Error: cannot read property 'name' of undefined". The 'ESLint' tag in the status bar also shows up in red with an exclamation mark.

I suspect my team's custom ESLint plugin. I'd like to see the stack trace of the failure, which would probably confirm or refute my theory.

Does VS Code keep logs for this kind of error? If so, where are they?

(I'm running it on a Mac.)

回答1:

On Linux there are some log files under ~/.config/Code/logs. Hope this helps.



回答2:

On Windows, it is at %AppData%\Code\logs



回答3:

I believe this is the directory you're looking for on MacOS: ~/Library/Application Support/Code/logs/. I'm not sure if extensions typically store their logs and stuff elsewhere, but they'll likely be somewhere in the Code folder.



回答4:

VSCode has a couple of commands for opening its logs folders. For the VSCode logs, you can use the Developer: Open Logs Folder command, and for VSCode extensions it's Developer: Open Extensions Logs Folder. You can search for those commands in the Command Palette in the usual way.

These commands spawn a new Finder window on OSX, or open in Windows Explorer on Windows.



回答5:

I'm working on a PHP project.My log files are in XAMPP/htdocs/audit directory