Rolling Log File Configuration
ProKnow DICOM Agent utilizes the Serilog .NET logging library along with its Serilog.Sinks.File package to provide rolling log file functionality. This feature causes the logging to automatically roll to a new log file based on configured time and/or log file size. It also allows configuration of the maximum number of log files. Together, this configuration can prevent runaway disk usage.
The rolling log file configuration can only be modified while ProKnow DICOM Agent is not executing. Use the Services tab within Task Manager to stop ProKnowDICOMAgentService prior to editing the configuration. The configuration is in the appsettings.json file located in the application installation folder (typically C:\Program Files\Elekta\ProKnow DICOM Agent). Make a backup of this file prior to attempting to edit it. Use a text editor such as Notepad to edit this file, making sure to preserve the JSON format.
Attempting to edit any other settings other than those specified below may cause ProKnow DICOM Agent to stop working.
The configurable log retention settings are:
- rollingInterval – Specifies the frequency at which the log file should roll. Set to "Day" by default, resulting in a new log file every day. Allowable values are "Infinite" (never rolls), "Year", "Month", and "Day".
- fileSizeLimitBytes – Specifies the file size threshold. Once reached, no further log messages will be written until the next roll point (see the rollOnFileSizeLimit setting). Set to 1048576 bytes (1 MB) by default. If this setting is removed, the file size is limited to 1 GB. If this setting is set to null, there is no file size limit (not recommended).
- retainedFileCountLimit – Specifies the number of log files retained. Once this limit is reached, older log files will be deleted. Set to 365 by default. Removing this setting limits the number of logs files to 31. If this setting is set to null, there is no limit to the number of log files (not recommended).
- rollOnFileSizeLimit – Specifies whether to roll to a new log file when the fileSizeLimitBytes setting is reached. Set to true by default. Allowable values are true and false.
Location of Log Files
The two "Path" settings in the appsettings.json file indicate the folders in which the log files are written. The application and anonymization log messages are written to separate files. The format of the filenames is app-YYYYMMDD.log for the application logs and anonymization-YYYYMMDD.log for the anonymization logs. If logging rolls over to additional log files during the day, the new log files will be named, for example, app-YYYYMMDD_001.log, app-YYYYMMDD_002.log, etc.
Long-Term Archiving of Log Files
A user can keep an archive of logs (e.g., anonymizations performed) by setting an automatic backup of their log files before they get deleted based on the log retention settings.