Open enricogior opened 3 years ago
What about chose a logging library and use rotation/retention capabilities?
For C# at the moment there are many loggers used:
ColorPicker https://github.com/microsoft/PowerToys/blob/master/src/modules/colorPicker/ColorPickerUI/Helpers/Logger.cs
Run https://github.com/microsoft/PowerToys/blob/master/src/modules/launcher/Wox.Plugin/Logger/Log.cs https://github.com/microsoft/PowerToys/blob/master/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Logger/ProgramLogger.cs
@davidegiacometti we should definitely use the same logger for all C# projects. Regarding rotation, I'm not a fan of it since we might loose information that we need. I would prefer a logger that logs by day and we should keep the last x days.
If we want to use a logging library I can work on this for the C# area but I am not sure to finish for 0.29 release.
Any preference for the library? nlog, log4net?
Would be nice to rely on Microsoft.Extensions.Logging
as abstraction even if there is no dependency injection since there are also unit tests.
@crutkas any thought on logging?
Logs in projects which use spdlog
are not erased properly due to a bug in that library. Namely, one function (init_filenames_q_
) assumes that logs are always written on consecutive days, which may not be true in case a user doesn't run PowerToys on some day. So perhaps we should try to fix that bug upstream.
Set as prio-2 for now, but it will be a prio-1 for the following release if not done in 0.37.
15 days or older
I just cleaned up 75GB of logs from C:\Users\Default\AppData\Local\Microsoft\PowerToys\RunnerLogs
. Running PowerToys v0.57.2 on Windows 11 Pro 21H2 (22000.613). Looking forward to a fix!
I’d love to see why we produced 75gb of logs
Same here. Just cleaned 31GB of logs from C:\Users\Default\AppData\Local\Microsoft\PowerToys\RunnerLogs
.
Running PowerToys v0.57.2 on Windows Server 2022 21H2 (20348.587)
@gabrielv33 can we do a screen share so we can see what is in one of those three Gig files?
@jaimecbernardo fyi
Trying to open them without crashing the VM (with somewhat limited RAM) was fun, but here we go:
I should just add that every single one of my 6 VMs running version 0.57.2 had this problem (logs between 27 GB and 37 GB), while the physical machine running version 0.57.0 did not (logs barely 200 KB).
@gabrielv33 @nichols-356 It seems this is a bug of running the first time from installer after an update on some systems. Restarting the computer after updating is the workaround here. Just to understand if this might be the case like in the other reports, are you using admin users with UAC off? This is the issue for the problem you're having: https://github.com/microsoft/PowerToys/issues/17720
Although from your logs it seems we can't get the Shell window we use to try to start as non-elevated... We need to fail instead of trying to re-run elevated with the same --dont-elevate
flag.
@jaimecbernardo
Only one of the machines with the problem were running PowerToys as admin. UAC is enabled on all the machines.
These paths (inaccessible without taking ownership or some other hacks) contain gigantic logs,,,
C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\PowerToys\RunnerLogs\ C:\Windows\ServiceProfiles\LocalService\AppData\Local\Microsoft\PowerToys\RunnerLogs\
@neoOpus, logs should be under your user, could there maybe be some type of special scenario you are doing?
Is this still an issue with the latest version?
This should be fixed
@jaimecbernardo am I wrong in believing this has been fixed?
This was fixed for installer logs recently. Not the logs for each utility.
Didn't https://github.com/microsoft/PowerToys/pull/19875 in 0.62 do this?
"Updates" folder is not the same as "Logs"
@jay-o-way well aware of that, my assumption is this work was done already which is why i'm calling this out and there may have been an expectation that was misunderstood.
Ping
Any update on that purge feature request?
PowerToys logs are created and never deleted, we should automatically clean up hold logs. We need to verify it for each module: