diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-08-14 20:09:19 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-08-14 20:09:19 +0300 |
| commit | ef22b8bc38d2f82b9939c2b6ff6a47d36abbe25b (patch) | |
| tree | e8a6ad246928442b20edf17ed098d1acba0add9e /Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs | |
| parent | 3d6c698db7add1bc7825f3b67611f0c18fe07e1d (diff) | |
| download | Tango-ef22b8bc38d2f82b9939c2b6ff6a47d36abbe25b.tar.gz Tango-ef22b8bc38d2f82b9939c2b6ff6a47d36abbe25b.zip | |
Improved FSE application termination analysis using settings. (increased crash report history to 1 hour instead of 10 minutes)
Diffstat (limited to 'Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs b/Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs index 722bceb56..8bc3729f2 100644 --- a/Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs +++ b/Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs @@ -102,7 +102,7 @@ namespace Tango.Logging return e.TryRecover; } - public Task<MessageLogItem> GetLastApplicationCrashEventLog() + public Task<MessageLogItem> GetLastApplicationCrashEventLog(int maxMinutes = 10) { return Task.Factory.StartNew<MessageLogItem>(() => { @@ -111,7 +111,7 @@ namespace Tango.Logging try { var applicationEvents = new EventLog("Application"); - var events = applicationEvents.Entries.Cast<EventLogEntry>().Where(x => x.EntryType == EventLogEntryType.Error && x.Source == ".NET Runtime" && x.TimeWritten > DateTime.Now.AddMinutes(-10)).OrderByDescending(x => x.TimeWritten).ToList(); + var events = applicationEvents.Entries.Cast<EventLogEntry>().Where(x => x.EntryType == EventLogEntryType.Error && x.Source == ".NET Runtime" && x.TimeWritten > DateTime.Now.AddMinutes(-maxMinutes)).OrderByDescending(x => x.TimeWritten).ToList(); Regex reg = new Regex("Application: (.+)"); @@ -131,7 +131,7 @@ namespace Tango.Logging logItem.Message += "---------------------------------------------------------------------------\n\n"; logItem.Message += ev.Message; logItem.TimeStamp = DateTime.Now; - logItem.Category = LogCategory.Error; + logItem.Category = LogCategory.Critical; break; } } |
