how to remove or stop auto generating debug.log file in vscode?

7.6k Views Asked by At

I'm working with nextjs project on the vscode. From a few days ago, debug.log file generated automatically for any directory where I'm working with. I want to stop generating this debug.log automatically, or at least want to know how to add this debug.log to the gitignore. I added .log, debug.log, **/debug.log, but gitignore don't works.

5

There are 5 best solutions below

0
On

uninstall then reinstall VScode worked for me.

step1: Go to Path: C:\Program Files\Microsoft VS Code

step2: run unins000.exe

step3: download and install VScode https://code.visualstudio.com/download

1
On

How about adding this below one?

*.log

in your .gitignore file

0
On

Maybe you need to remove cached *.log files in your project by running git rm --cached *.log, then stage your .gitignore file using git add .gitignore or you can use git add .

My reference: How to use gitignore command in git

1
On

this issue can be resolved by removing the (*).log what that does is make the file editable or not required should end up looking something like this

# Logs
logs
.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

this is specifically for react but it might just work for you

0
On

Make sure "Exclude Git Ignore" is checked in settings:

screenshot