Severity: Info
Files / Lines:
src/Servy.Core/Config/AppConfig.cs:272 — public const int DefaultRotationSize = 10;
src/Servy.Core/Logging/Logger.cs:20 — public const int DefaultLogRotationSizeMB = 10;
Description:
Two separate constants both encode the same default — 10 MB log rotation size — in two different namespaces:
AppConfig.DefaultRotationSize is consumed by domain/mapper/CLI/options code (e.g. Servy.Core/Domain/Service.cs:133, ServiceMapper.cs:117, ServiceDtoHelper.cs:38, InstallServiceOptions.cs:45, InstallServiceCommand.cs:68, StartOptionsParser.cs:54, Servy/Mappers/ServiceConfigurationMapper.cs:35, MainViewModel.cs:835/1167/1329/1407).
Logger.DefaultLogRotationSizeMB is consumed by the static logger fallback path (Servy/AppBootstrapper.cs:215, Servy.CLI/Program.cs:126, Servy.Service/Service.cs:342).
Both happen to equal 10 today, but they are not linked. A future tweak to one (e.g. raising the global default to 25) leaves the other behind, and the per-service rotation default and the static-logger default silently disagree.
Suggested fix:
Pick one source of truth. Easiest is to delete Logger.DefaultLogRotationSizeMB and reference AppConfig.DefaultRotationSize directly from the three call sites. Alternatively, define Logger.DefaultLogRotationSizeMB = AppConfig.DefaultRotationSize (this works because both are const int).
Severity: Info
Files / Lines:
src/Servy.Core/Config/AppConfig.cs:272—public const int DefaultRotationSize = 10;src/Servy.Core/Logging/Logger.cs:20—public const int DefaultLogRotationSizeMB = 10;Description:
Two separate constants both encode the same default — 10 MB log rotation size — in two different namespaces:
AppConfig.DefaultRotationSizeis consumed by domain/mapper/CLI/options code (e.g.Servy.Core/Domain/Service.cs:133,ServiceMapper.cs:117,ServiceDtoHelper.cs:38,InstallServiceOptions.cs:45,InstallServiceCommand.cs:68,StartOptionsParser.cs:54,Servy/Mappers/ServiceConfigurationMapper.cs:35,MainViewModel.cs:835/1167/1329/1407).Logger.DefaultLogRotationSizeMBis consumed by the static logger fallback path (Servy/AppBootstrapper.cs:215,Servy.CLI/Program.cs:126,Servy.Service/Service.cs:342).Both happen to equal
10today, but they are not linked. A future tweak to one (e.g. raising the global default to 25) leaves the other behind, and the per-service rotation default and the static-logger default silently disagree.Suggested fix:
Pick one source of truth. Easiest is to delete
Logger.DefaultLogRotationSizeMBand referenceAppConfig.DefaultRotationSizedirectly from the three call sites. Alternatively, defineLogger.DefaultLogRotationSizeMB = AppConfig.DefaultRotationSize(this works because both areconst int).