Esempio n. 1
0
        public ActionResult DisplayLog()
        {
            parserContent = (LogDisplay)Session["parserContent"];

            LogParserFilter filter;

            if (Session["filter"] != null)
            {
                filter = (LogParserFilter)Session["filter"];
            }
            else
            {
                filter = new LogParserFilter();
                filter.FilterNumberOfLogItems = searchNumberOfItems;
            }

            if (parserContent == null)
            {
                parserContent = new LogDisplay();
                parserContent.Parsing10MBLogFile(null, null, null, null);
            }

            ViewData["Id"]      = Session["Id"];
            ViewData["Content"] = parserContent;
            ViewData["filter"]  = filter;
            ViewData["numberOfItemsPerPage"] = numberOfItemsPerPage;
            ViewData["matchWholeWordFilter"] = Session["matchWholeWordFilter"];
            ViewData["searchContent"]        = Session["searchContent"];
            Session["parserContent"]         = parserContent;

            return(View());
        }
Esempio n. 2
0
        public ActionResult Reload(string levelSelect,
                                   string StartTime,
                                   string EndTime,
                                   string ThreadId,
                                   string numberOfItems,
                                   string searchType,
                                   string Search)
        {
            string fileSelected;
            string filePattern;
            char   fileSeparator;

            LogParserFilter filter = LoadParameters.CreateFilter(levelSelect, StartTime,
                                                                 EndTime, ThreadId,
                                                                 numberOfItems, searchType,
                                                                 Search, false);

            parserContent = new LogDisplay();

            fileSelected  = (string)Session["fileSelected"];
            filePattern   = (string)Session["filePattern"];
            fileSeparator = (char)Session["fileSeparator"];

            parserContent.Parsing10MBLogFile(filter, fileSelected, filePattern, fileSeparator);

            parserContent = LocalSearchFilter.Filter(parserContent, null, null, searchType, Search);

            Session["parserContent"] = parserContent;

            return(RedirectToAction("Display"));
        }
Esempio n. 3
0
        public ActionResult Load(
            string levelSelect, string StartTime,
            string EndTime, string ThreadId,
            string numberOfItems, string numberOfItemsPerPage,
            string searchType,
            string Search)
        {
            string fileSelected;
            string filePattern;
            char   fileSeparator;

            //Default values
            if (!string.IsNullOrEmpty((string)Session["fileSelected"]))
            {
                fileSelected = (string)Session["fileSelected"];
            }
            else
            {
                fileSelected = @"..\..\..\Data\Samples\LogConfig.xml"; // Default file
            }
            if (!string.IsNullOrEmpty((string)Session["filePattern"]))
            {
                filePattern = (string)Session["filePattern"];
            }
            else
            {
                filePattern = "Time|Level|Message";
            }

            if (Session["fileSeparator"] != null)
            {
                fileSeparator = (char)Session["fileSeparator"];
            }
            else
            {
                fileSeparator = '|';
            }
            //Default values - end

            //Get number of log entries in log file
            LogParserFilter filter = LoadParameters.CreateFilter(null, null,
                                                                 null, null,
                                                                 null, null,
                                                                 null, true);

            parserContent = new LogDisplay();

            // parserContent.Parsing10MBLogFile(filter, fileSelected, filePattern, fileSeparator);

            //  numberOfLogItems = parserContent.LineParse.NumberOfLogItems;

            filter = LoadParameters.CreateFilter(levelSelect, StartTime,
                                                 EndTime, ThreadId, numberOfItems,
                                                 searchType, Search, false);

            parserContent.Parsing10MBLogFile(filter, fileSelected, filePattern, fileSeparator);

            Session["parserContent"]             = parserContent;
            Session["fileSelected"]              = fileSelected;
            Session["numberOfItemsPerPage"]      = numberOfItemsPerPage;
            Session["numberOfLogItems"]          = parserContent.LineParse.ElementsLog.Count;
            Session["numberOfLogItemsInLogFile"] = numberOfLogItems;
            Session["currentLogIndex"]           = 1;

            //Default numberOfItemsPerPage
            if (string.IsNullOrEmpty(numberOfItemsPerPage))
            {
                numberOfItemsPerPage = "51";
            }

            Session["numberOfItemsPerPage"] = int.Parse(numberOfItemsPerPage) - 1;

            return(RedirectToAction("ShowNextLogEntries"));
        }