         // Use a serial queue to ensure that the same analytics data do not get sent more than once
         dispatch_async(Logger.sendAnalyticsToServerQueue) { () -> Void in
             do {
-                let logsToSend: String? = try getLogs(fileName: FILE_ANALYTICS_LOGS, overflowFileName:FILE_ANALYTICS_OVERFLOW, bufferFileName: FILE_ANALYTICS_SEND)
-                if let logPayload = logsToSend, request = buildLogSendRequest(analyticsSendCallback) {
-                    
-                    // Everything went as expected, so send the logs!
+                // Gather the logs and put them in a JSON object
+                let logsToSend: String? = try getLogs(fileName: FILE_ANALYTICS_LOGS, overflowFileName: FILE_ANALYTICS_OVERFLOW, bufferFileName: FILE_ANALYTICS_SEND)
+                var logPayloadData = try NSJSONSerialization.dataWithJSONObject([], options: [])
+                if let logPayload = logsToSend {
                     let logPayloadJson = ["__logdata": logPayload]
-                    let logPayloadData = try NSJSONSerialization.dataWithJSONObject(logPayloadJson, options: [])
-                    request.sendData(logPayloadData, withCompletionHandler: analyticsSendCallback)
+                    logPayloadData = try NSJSONSerialization.dataWithJSONObject(logPayloadJson, options: [])
                 }
                 else {
                     Analytics.logger.info("There are no analytics data to send.")
+                }
+                
+                // Send the request, even if there are no logs to send (to keep track of device info)
+                if let request = buildLogSendRequest(analyticsSendCallback) {
+                    request.sendData(logPayloadData, withCompletionHandler: analyticsSendCallback)
                 }
             }
             catch let error as NSError {

    
    
    // The buffer file is typically the one used for storing logs that will be sent to the server
    internal static func deleteBufferFile(bufferFile: String) {
        
        if Logger.fileManager.isDeletableFileAtPath(bufferFile) {
            do {
                try Logger.fileManager.removeItemAtPath(bufferFile)
            }
            catch let error {
                Logger.internalLogger.error("Failed to delete log file \(bufferFile) after sending. Error: \(error)")

        // Use a serial queue to ensure that the same logs do not get sent more than once
        dispatch_async(Logger.sendLogsToServerQueue) { () -> Void in
            do {
                // Gather the logs and put them in a JSON object
                let logsToSend: String? = try getLogs(fileName: FILE_LOGGER_LOGS, overflowFileName: FILE_LOGGER_OVERFLOW, bufferFileName: FILE_LOGGER_SEND)
                var logPayloadData = try NSJSONSerialization.dataWithJSONObject([], options: [])
                if let logPayload = logsToSend {
                    let logPayloadJson = ["__logdata": logPayload]
                    logPayloadData = try NSJSONSerialization.dataWithJSONObject(logPayloadJson, options: [])
                }
                else {
                    Logger.internalLogger.info("There are no logs to send.")
                }
                
                // Send the request, even if there are no logs to send (to keep track of device info)
                if let request = buildLogSendRequest(logSendCallback) {
                    request.sendData(logPayloadData, withCompletionHandler: logSendCallback)
                }
            }
            catch let error as NSError {
