Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
triplespark opened this issue May 22, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@triplespark
Copy link

triplespark commented May 22, 2024

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

  • According to my tests, original MS code does not have a directory in ~/.config/, only VSCodium has.

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

  • Search returned no results.

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

  • OS: Linux Debian
  • Architecture x64
  • Version 1.85.2
  • Debian package manager
  • Sandboxed: no
@triplespark triplespark added the bug Something isn't working label May 22, 2024
@daiyam
Copy link
Member

daiyam commented May 22, 2024

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

@daiyam daiyam self-assigned this May 22, 2024
@triplespark
Copy link
Author

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
Copy link
Member

daiyam commented May 23, 2024

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
Copy link
Author

Submitted it here: microsoft/vscode#213322

@daiyam
Copy link
Member

daiyam commented May 23, 2024

I've provided my feedback...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants