Exemplo n.º 1
0
        // Copy and zip logs
        private void CreateLogs()
        {
            ClientFunctions.CreateClientServerLogFolder();

            ClientFunctions.CopyLogs(ClientFunctions.ClientLogsPath, ClientFunctions.ClientLogsTempPath, true);
            ClientFunctions.CopyLogs(ClientFunctions.ClientConfPath, ClientFunctions.ClientConfTempPath, true);
            ClientFunctions.CopyLogs(ClientFunctions.ServerLogsPath, ClientFunctions.ServerLogsTempPath, true);

            ClientFunctions.ZipLogs(ClientFunctions.LogsTempPath, ClientFunctions.LogsTempPathZip);

            log.Info("Logs successfully created.");

            // Send logs to server
            this.Send();
            log.Info("Send logs to the server.");

            // Wait until logs has been sent
            sendDone.WaitOne();

            log.Info("Logs have been successfully sent to the server.");
            log.Info("");

            // Delete the temporary logs folder
            ClientFunctions.DeleteLogFolderAfterSent();

            this.WaitForSignal();
        }