Esempio n. 1
0
 internal FileLogReader(FileLogSource logSource)
 {
     this.logSource = logSource;
     if (!string.IsNullOrWhiteSpace(logSource.OpeningLinePattern))
     {
         regex = new Regex(logSource.OpeningLinePattern, RegexOptions.Compiled | RegexOptions.IgnoreCase);
     }
 }
Esempio n. 2
0
        public ActionResult ReadFile(string host, string folder, string file)
        {
            var folderInfo = configProvider.Config.GetHost(host).GetFolder(folder);

            var source = new FileLogSource(file, folderInfo);
            var logs = logReader.ReadFromEnd(source);
            var model = logs.Select(x => new LogEntryModel(x));

            return View("_Logs", model);
        }