         // File Size
         guard currentLogFileSize < targetMaxFileSize else { return true }
 
-        // Time Interval
+        // Time Interval, zero = never rotate
+        guard targetMaxTimeInterval > 0 else { return false }
+
+        // Time Interval, else check time
         guard Date().timeIntervalSince1970 - currentLogStartTimeInterval < targetMaxTimeInterval else { return true }
 
         return false

    }

    /// Option: desired maximum time in seconds stored in a log file, if 0, no maximum (log files may exceed this, it's a guideline only)
    open var targetMaxTimeInterval: TimeInterval = 600 {
        didSet {
            if targetMaxTimeInterval < 1 {
                targetMaxTimeInterval = 600
            }
        }
    }


import Foundation

fileprivate let AutoRotatingFileDefaultMaxFileSize: UInt64 = 1_048_576
fileprivate let AutoRotatingFileDefaultMaxTimeInterval: TimeInterval = 600

// MARK: - AutoRotatingFileDestination
/// A destination that outputs log details to files in a log folder, with auto-rotate options (by size or by time)
open class AutoRotatingFileDestination: FileDestination {
    // MARK: - Properties
    /// Option: desired maximum size of a log file, if 0, no maximum (log files may exceed this, it's a guideline only)
    open var targetMaxFileSize: UInt64 = AutoRotatingFileDefaultMaxFileSize {
        didSet {
            if targetMaxFileSize < 1 {
                targetMaxFileSize = .max
