I am Using cocoaLumberjack logging framework for iOS logging. For storing logs in a file I used this code.
DDFileLogger* fileLogger = [[DDFileLogger alloc] i
I don't know if this might help somebody else... I took the previous answers and passed it to Swift 5. Apart from getting all the paths, it prints the content.
let logFileLogger = DDFileLogger()
print(logFileLogger.logFileManager.logsDirectory)
for path in logFileLogger.logFileManager.sortedLogFilePaths {
do {
let content = try String(contentsOfFile: path, encoding: .utf8)
print(content)
} catch let error as NSError {
print("Error: \(error.localizedDescription)")
}
}