Inherits from DDAbstractLogger : NSObject
Conforms to DDLogger
Declared in DDFileLogger.h

Tasks

Properties

automaticallyAppendNewlineForCustomFormatters

@property (nonatomic, readwrite, assign) BOOL automaticallyAppendNewlineForCustomFormatters
Discussion

When using a custom formatter you can set the logMessage method not to append ‘\n’ character after each output. This allows for some greater flexibility with custom formatters. Default value is YES.

Declared In

DDFileLogger.h

doNotReuseLogFiles

@property (readwrite, assign, atomic) BOOL doNotReuseLogFiles

logFileManager

@property (strong, nonatomic, readonly) id<DDLogFileManager> logFileManager
Discussion

The DDLogFileManager instance can be used to retrieve the list of log files, and configure the maximum number of archived log files to keep.

See Also

Declared In

DDFileLogger.h

maximumFileSize

@property (readwrite, assign) unsigned long long maximumFileSize
Discussion

Log File Rolling:

maximumFileSize: The approximate maximum size to allow log files to grow. If a log file is larger than this value after a log statement is appended, then the log file is rolled.

rollingFrequency How often to roll the log file. The frequency is given as an NSTimeInterval, which is a double that specifies the interval in seconds. Once the log file gets to be this old, it is rolled.

Both the maximumFileSize and the rollingFrequency are used to manage rolling. Whichever occurs first will cause the log file to be rolled.

For example: The rollingFrequency is 24 hours, but the log file surpasses the maximumFileSize after only 20 hours. The log file will be rolled at that 20 hour mark. A new log file will be created, and the 24 hour timer will be restarted.

You may optionally disable rolling due to filesize by setting maximumFileSize to zero. If you do so, rolling is based solely on rollingFrequency.

You may optionally disable rolling due to time by setting rollingFrequency to zero (or any non-positive number). If you do so, rolling is based solely on maximumFileSize.

If you disable both maximumFileSize and rollingFrequency, then the log file won’t ever be rolled. This is strongly discouraged.

Declared In

DDFileLogger.h

rollingFrequency

@property (readwrite, assign) NSTimeInterval rollingFrequency

Instance Methods

currentLogFileInfo

- (DDLogFileInfo *)currentLogFileInfo
Discussion

Returns the log file that should be used. If there is an existing log file that is suitable, within the constraints of maximumFileSize and rollingFrequency, then it is returned.

Otherwise a new file is created and returned.

Declared In

DDFileLogger.h

init

- (instancetype)init

initWithLogFileManager:

- (instancetype)initWithLogFileManager:(id<DDLogFileManager>)logFileManager

rollLogFile

- (void)rollLogFile

rollLogFileWithCompletionBlock:

- (void)rollLogFileWithCompletionBlock:(void ( ^ ) ( ))completionBlock