public static string GetLogfilePath(string logfile)
        {
            string        currentPath = Log4netHelpers.GetLogFileFolder("SynapseServer");
            DirectoryInfo directory   = new DirectoryInfo(currentPath);

            return(Path.Combine(currentPath, logfile));
        }
Beispiel #2
0
        public static string GetLogfilePath(string logfile)
        {
            string currentPath = Log4netHelpers.GetLogFileFolder("SynapseServer");

            if (!string.IsNullOrWhiteSpace(currentPath))
            {
                DirectoryInfo directory = new DirectoryInfo(currentPath);
                return(Path.Combine(currentPath, logfile));
            }
            else
            {
                return(null);
            }
        }
        public static List <AutoUpdaterMessage> FetchLogList()
        {
            string                 currentPath = Log4netHelpers.GetLogFileFolder("SynapseServer");
            DirectoryInfo          directory   = new DirectoryInfo(currentPath);
            IEnumerable <FileInfo> logs        = directory.GetFiles("*.log", SearchOption.TopDirectoryOnly)
                                                 .OrderByDescending(f => f.LastWriteTime);

            List <AutoUpdaterMessage> logFiles = new List <AutoUpdaterMessage>();

            foreach (FileInfo log in logs)
            {
                logFiles.Add(new AutoUpdaterMessage()
                {
                    TimeStamp = log.LastWriteTime, Message = log.Name
                });
            }

            return(logFiles);
        }