Question about CocoaLumberjack Behavior - Deleting All Files when logFilesDiskQuota is Reached #1391
Replies: 1 comment
-
You're almost right here. |
Beta Was this translation helpful? Give feedback.
-
You're almost right here. |
Beta Was this translation helpful? Give feedback.
-
Hello CocoaLumberjack community,
I'm currently using CocoaLumberjack version 3.8.2, and I've noticed a behavior that seems unexpected to me regarding the management of log files when the logFilesDiskQuota is set.
Details:
CocoaLumberjack Version: 3.8.2
Configuration:
let fileManagerDefault = BaseFileManagerDefault(logsDirectory: path)
fileLogger = DDFileLogger(logFileManager: fileManagerDefault) // File Logger
fileLogger?.maximumFileSize = 0
fileLogger?.logFileManager.maximumNumberOfLogFiles = 7
fileLogger?.logFileManager.logFilesDiskQuota = 1_024 * 1_024 * 30
When the total size of log files exceeds the specified logFilesDiskQuota, it appears that all log files are deleted, and a new one is generated.
According to Documentation - On rolling logfile all old log files that exceed logFilesDiskQuota will be deleted.
According to this, I expected CocoaLumberjack to remove those older log files which is greater than this logFilesDiskQuota until total size of the log files back within the specified quota.
For e.g. Suppose if we take logFilesDiskQuota = 30 MB, So if one files is 25 MB and another is 8 MB. So it should delete 25 MB file right? Because 8MB is within logFilesDiskQuota. Right now all files are getting deleted.
I appreciate any insights or guidance you can provide.
Beta Was this translation helpful? Give feedback.
All reactions