private string GetLogData(string sessionId) { string logFilePath; string pattern; if (GlobalSettings.IsDistributedSystem) { logFilePath = @"C:\VirtualResource\Distribution\SessionProxy\Logs"; pattern = "SessionProxy-{0}".FormatWith(sessionId); } else { logFilePath = LogFileReader.DataLogPath(); pattern = "StfWebService.exe.log"; } StringBuilder builder = new StringBuilder(); var logFiles = LogFileDataCollection.Create(logFilePath); foreach (var file in logFiles.Items.Where(x => x.FileName.StartsWith(pattern, StringComparison.OrdinalIgnoreCase))) { builder.AppendLine(file.FileData); } return(builder.ToString()); }
/// <summary> /// Gets the dispatcher log data. /// </summary> /// <returns> /// A string buffer containing the current log data /// </returns> public string GetSessionLogFiles(string sessionId) { SetTraceSessionContext(sessionId); if (string.IsNullOrEmpty(sessionId)) { return("Session does not exist"); } string logFilePath = string.Empty; string pattern = string.Empty; if (GlobalSettings.IsDistributedSystem) { string location = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); logFilePath = Path.Combine(Path.GetDirectoryName(location), "SessionProxy", "Logs"); //the log extension was missing previously pattern = "SessionProxy-{0}.log".FormatWith(sessionId); } else { logFilePath = LogFileReader.DataLogPath(); pattern = "STBConsole.log"; } StringBuilder builder = new StringBuilder(); var logFiles = LogFileDataCollection.Create(logFilePath); foreach (var file in logFiles.Items.Where(x => x.FileName.Equals(pattern))) { builder.AppendLine(file.FileData); } return(builder.ToString()); }
public static void SaveLogFiles(string location) { LogFileDataCollection logFiles = LogFileDataCollection.Create(location); TraceFactory.Logger.Debug($"Location={location}. Collection Size={Math.Round(logFiles.SizeInMb, 3)} MB."); Run(c => c.SaveLogFiles(logFiles)); }
/// <summary> /// Gets the Log Files /// </summary> /// <returns></returns> public LogFileDataCollection GetLogFiles() { return(LogFileDataCollection.Create(LogFileReader.DataLogPath())); }
/// <summary> /// Gets the log files. /// </summary> /// <param name="sessionId">The session identifier.</param> /// <returns>LogFileDataCollection.</returns> public LogFileDataCollection GetCitrixLogFiles(string sessionId) { return(LogFileDataCollection.Create(LogFileReader.DataLogPath(sessionId))); }
/// <summary> /// Tells the service to copy any logs that are unique to this resource. /// </summary> public virtual LogFileDataCollection GetLogFiles(string sessionId) { return(LogFileDataCollection.Create(LogFileReader.DataLogPath())); }