Hi there,
I have a bit of an annoying bug where the global settings for log retention are written in an invalid format to GlobalSettings.config when you configure nested folders. This is best explained with an example. Let's say I have this configuration:
These settings are stored in global settings as follows:
<FilesRetentionSettings> <PurgeEnabled>True</PurgeEnabled> <IncludeSubFolders> <System> <Log>True</Log> <Diagnostics>True</Diagnostics> </System> </IncludeSubFolders> <Retention> <System> <Log>14</Log> <Diagnostics>30</Diagnostics> </System> </Retention> <LogLocations>/System/Log|/System/Diagnostics</LogLocations> </FilesRetentionSettings>
This looks fine to me and registers a 14 and 30 day retention for the System/Log and System/Diagnostics folders respectively.
Now when I add /System/Log/ScheduledTasks as follows:
and save my changes, the file is written as follows:
<FilesRetentionSettings> <PurgeEnabled>True</PurgeEnabled> <IncludeSubFolders> <System> <Log>True<ScheduledTasks>False</ScheduledTasks></Log> <Diagnostics>True</Diagnostics> </System> </IncludeSubFolders> <Retention> <System> <Log>30<ScheduledTasks>30</ScheduledTasks></Log> <Diagnostics>30</Diagnostics> </System> </Retention> <LogLocations>/System/Log|/System/Diagnostics|/System/Log/ScheduledTasks</LogLocations> </FilesRetentionSettings>
Note how the ScheduledTasks element is now nested inside the Log element.
This is annoying because it'll work OK as long as the site isn't recycled. But when it restarts, the log settings end up broken:
(In other cases, some of the retention settings may contain a number like 3030 (a concatenation of the two values) meaning log files aren't cleared up for a long time which is also bad :-) )
This means no logs are kept so the next time the clean up task runs, all logs are deleted. And that is a big issue for the OData provider using a delta modifier. Tasks that use OData with a delta modifier depend on the last date and time the job ran being written to a log file. It then sends that date as a filter to the ERP (i.e. lastModifiedDateTime=2025-03-01 16:23). When the log file does not exist, no date is added and *all* records are retrieved from the ERP. This has caused multiple cases of importing 200K records in the morning whereas only 2 records had changed :-(
Can this be looked at? I think for the time being I can work around this by not configuring nested folders, but it would be nice to have this work properly.
Imar