You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue:
The literal string "logs" (the subdirectory under AppConfig.ProgramDataPath) is hardcoded in three separate places in Logger.cs:
// Line 91 — InternalInitialize main pathvarlogDir=Path.Combine(AppConfig.ProgramDataPath,"logs");// Line 120 — InternalInitialize fallback (init failure)varlogDir=Path.Combine(AppConfig.ProgramDataPath,"logs");// Line 349 — Log() catch block fallbackvarlogDir=Path.Combine(AppConfig.ProgramDataPath,"logs");
Why this matters:
If anyone ever wants to relocate the log directory (e.g. for portable installs, custom deployments, or compliance-driven layout changes), three sites must be updated in lockstep. Forgetting one creates "ghost" files in the wrong place — and the third site only fires on logger errors, so the bug would only surface during incidents.
Inconsistent with the rest of the codebase, where path constants live in AppConfig (e.g. ServyServiceUIExe, ServyServiceCLIExe, GetHandleExePath()).
Replace the three call sites with AppConfig.LogsPath. (LogTailer/LogsViewModel and any other consumer of the same directory should also be updated to use this constant.)
Severity: Info
File:
src/Servy.Core/Logging/Logger.csLines: 91, 120, 349
Issue:
The literal string
"logs"(the subdirectory underAppConfig.ProgramDataPath) is hardcoded in three separate places in Logger.cs:Why this matters:
AppConfig(e.g.ServyServiceUIExe,ServyServiceCLIExe,GetHandleExePath()).Suggested fix:
Add a constant to
AppConfig:Replace the three call sites with
AppConfig.LogsPath. (LogTailer/LogsViewModeland any other consumer of the same directory should also be updated to use this constant.)