VSCodium / vscodium

binary releases of VS Code without MS branding/telemetry/licensing
https://vscodium.com
MIT License
24.27k stars 1.02k forks source link

VSCodium creates log files in ~/.config/VSCodium/logs/ which is not an appropriate place for log files. #1903

Open triplespark opened 1 month ago

triplespark commented 1 month ago

Describe the bug VSCodium creates logs in the directory ~/.config/VSCodium/logs/

The ~/.config directory is not the right place to put log files.

In my installation, these logs look like this: ~/.config/VSCodium/logs/20240522T223215/window1/renderer.log

The content is: 2024-05-22 22:42:50.153 [error] [Extension Host] Errored result: [object Object] 2024-05-22 22:42:50.153 [error] [Extension Host] Errored result: [object Object] 2024-05-22 22:42:50.154 [error] [Extension Host] Errored result: [object Object] 2024-05-22 22:42:50.155 [error] [Extension Host] Errored result: [object Object]

The fact that these errors are created probably goes to PlatformIO or IntelliSense and after 1 hour of work, these files can make up hundreds of MBytes.

The bug that I'm reporting here is the mere fact that log files are generated in ~/.config. The log file path suggests it is created by the application core itself (window1 render task) and not by any plugin. The ~/.config directory is not appropriate for logs. Also, these never seem to be cleaned up and accumulate ad infinitum.

Please confirm that this problem is VSCodium-specific

Please confirm that the issue/resolution isn't already documented

To Reproduce For me it's as simply as starting codium in a directory that needs platformio, but probably other ways work as well.

Expected behavior Put log files somewhere else, I'd vote for the temporary system directory /tmp/ . You can use mkstemp() or similar to create a directory there.

Screenshots N/A

Desktop (please complete the following information):

daiyam commented 1 month ago

The ~/.config directory is not the right place to put log files.

I agree

The fact that these errors are created probably goes to PlatformIO or IntelliSense and after 1 hour of work, these files can make up hundreds of MBytes.

That's bad!

On VSCode, does VSCode generate the same error ([error] [Extension Host] Errored result: [object Object])?

By looking at VSCode,

https://github.com/microsoft/vscode/blob/eccc47493a39ad1e6ecf9b754989d3744759a10f/src/vs/workbench/services/environment/electron-sandbox/environmentService.ts#L99

https://github.com/microsoft/vscode/blob/eccc47493a39ad1e6ecf9b754989d3744759a10f/src/vs/platform/environment/common/environmentService.ts#L76

If --logsPath argument is not provided, it creates the logs in the userDataPath ($XDG_CONFIG_HOME/VSCodium or ~/.config/VSCodium)...

https://github.com/microsoft/vscode/blob/2070db107d8c3e1e3ddeddc7b12563c7c3c5815d/src/vs/platform/environment/node/userDataPath.js#L95

A patch is needed! It's weird that you are the first one to have reported the issue. It should have been an issue for others...

triplespark commented 1 month ago

I had a college check (because I do not have VSCode). The VSCode seems to create log files under the same location. He had about 11 MBytes of accumulated log files in the config dir. The specific high volume of errors are only generated when the Platformio plugin is active but what I like to see fixed somewhere (maybe also by mainstream Microsoft) is to change the log dir to be outside .config by default.

daiyam commented 1 month ago

what I like to see fixed somewhere (maybe also by mainstream Microsoft) is to change the log dir to be outside .config by default.

I agree.

maybe also by mainstream Microsoft

You could report the issue to VSCode.

In the meantime, you could use the argument --logsPath.

triplespark commented 1 month ago

Submitted it here: https://github.com/microsoft/vscode/issues/213322

daiyam commented 1 month ago

I've provided my feedback...