1

I've a scenario where I want to force the log file to roll out (synchronously) even before the maxfilesize is reached so that I can upload the log to the server. I do see this public method rollLogFile that I can call. But this method puts the rollLogFileNow method call(which actually rolls the log files) on an asynchronous queue. But, I want to roll out the log file synchronously as and when I need to, so that once it's rolled out I can upload the file to the server. Can someone please let me know how this can be done? I'm e newbie in using Lumberjack framework.

oguz ismail
  • 1
  • 16
  • 47
  • 69

2 Answers2

2

Use [DDFileLogger rollLogFile]

Bogdan
  • 101
  • 2
0

There is a method available on DDFileLogger that allows you to pass a block to be executed upon completion of the rollover.

[DDFileLogger rollLogFileWithCompletionBlock:(nullable void (^)(void))completionBlock)];
Sandeep Phadke
  • 862
  • 9
  • 23