0

I have configured library like below

    let fileLogger: DDFileLogger = DDFileLogger() 
    fileLogger.rollingFrequency = -1
    fileLogger.maximumFileSize = 1024 * 1024
    fileLogger.logFileManager.maximumNumberOfLogFiles = 7
    DDLog.add(fileLogger)

File has to roll only if it reaches 1MB size. Recently i observed one thing, if app running in simulator with background mode enabled. New log file is creating on every time app launch irrespective of file size. Is this known thing?. Because NSFileProtectionType is nil inside doesAppRunInBackground() condition in DDFileLogger.m class. But it is working fine in device

oguz ismail
  • 1
  • 16
  • 47
  • 69
Logger
  • 1,274
  • 1
  • 14
  • 25

1 Answers1

0

Try setting

fileLogger.logFileManager.maximumNumberOfLogFiles = 1;

If that does not work then try setting NSFileProtectionType to either true or 1 inside doesAppRunInBackground() function inside the DDFileLogger.m class.

CodeChanger
  • 7,953
  • 5
  • 49
  • 80
devdchaudhary
  • 467
  • 2
  • 13