示例#1
0
        public static string GetLogfilePath(string logfile)
        {
            string        currentPath = Log4netHelpers.GetLogFileFolder("SynapseServer");
            DirectoryInfo directory   = new DirectoryInfo(currentPath);

            return(Path.Combine(currentPath, logfile));
        }
示例#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);
            }
        }
示例#3
0
        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);
        }