Log File Management and Archiving
The Resolution Service uses a rolling file appender to manage and archive log files efficiently. This ensures that log files do not grow indefinitely and that older logs are archived systematically.
Log Archiving Configuration
The logback.xml configuration file defines how the log files are rotated, archived, and deleted over time. The following outlines the main log file handling:
Main Log File: resolutionservice.log
2. Rolling Policy
The log file rolls over based on both time and file size, ensuring that the logs are archived regularly.
-
Daily Rolling – A new log file is created each day, helping to keep logs organized by date.
-
File Size Limit – If a log file exceeds 10MB within a day, it rolls over to a new file. This prevents any single log from growing too large.
3. Archived File Pattern
Archived log files are saved in the logs/archived/ directory using the following naming convention:
resolutionservice.yyyy-MM-dd.i.log
Where:
-
yyyy-MM-ddis the date when the log file was created. -
iis a counter used when multiple files are created on the same day due to file size limits.
Warning Log File (warning-resolutionservice.log)
2. Rolling Policy
Similar to the main log file, the warning log file rolls over based on time and size:
-
Daily Rolling – A new warning log file is created each day.
-
File Size Limit – A new log file is created if the current warning log exceeds 10MB.
Summary of Log Locations
-
Current Logs:
-
logs/resolutionservice.log -
logs/warning-resolutionservice.log -
Archived Logs:
-
logs/archived/-
resolutionservice.yyyy-MM-dd.i.log -
warning-resolutionservice.yyyy-MM-dd.i.log
-
This log management strategy helps keep the logs organized, manageable, and prevents excessive disk usage by automatically archiving and cleaning up old log files.