Bruce
Bruce

Reputation: 8420

Where are Visual Studio Code log files?

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.)

Upvotes: 59

Views: 126135

Answers (6)

serg10
serg10

Reputation: 32667

VS Code has a couple of commands for opening its logs folders:

  • For VS Code logs, you can use the Developer: Open Logs Folder command.
  • For VS Code 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 macOS, or open in File Explorer on Windows.

Upvotes: 61

Robbie Smith
Robbie Smith

Reputation: 482

For clarification if anyone else stumbles on this, type >Developer: Open Logs Folder with the> symbol to start

Upvotes: 8

Sam
Sam

Reputation: 499

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

Upvotes: 30

steel
steel

Reputation: 12520

You can use the VSC command palette.

VSC stores its logs in various files depending on the purpose of those logs. There are a few commands to view them.

  1. View the logs in your editor with the command:

    >Developer: Show logs
    

    Then select which log file you want to view.

OR

  1. View the log files in your file navigator with the command:

    >Developer: Open Logs Folder
    

Screenshot of command pallet log options command pallet: >developer show logs

Upvotes: 6

beenhazed
beenhazed

Reputation: 349

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

Upvotes: 18

Erik Nelson
Erik Nelson

Reputation: 175

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.

Upvotes: 12

Related Questions