diff --git a/Disco.BI/BI/AttachmentBI/Utilities.cs b/Disco.BI/BI/AttachmentBI/Utilities.cs index 1b28b5c1..63799177 100644 --- a/Disco.BI/BI/AttachmentBI/Utilities.cs +++ b/Disco.BI/BI/AttachmentBI/Utilities.cs @@ -1,9 +1,10 @@ -using System; +using Disco.BI.Extensions; +using Exceptionless; +using iTextSharp.text.pdf; +using System; using System.Drawing; using System.IO; using System.Linq; -using Disco.BI.Extensions; -using iTextSharp.text.pdf; namespace Disco.BI.AttachmentBI { @@ -33,10 +34,11 @@ namespace Disco.BI.AttachmentBI } } } - catch (Exception) + catch (Exception ex) { + ex.ToExceptionless().Submit(); + // Ignore Thumbnail Generation exceptions for images - //throw; } } @@ -63,6 +65,10 @@ namespace Disco.BI.AttachmentBI } } } + catch (Exception ex) + { + ex.ToExceptionless().Submit(); + } finally { if (pdfReader != null) diff --git a/Disco.BI/BI/DeviceBI/Enrol.cs b/Disco.BI/BI/DeviceBI/Enrol.cs index 2a168e1d..f7e3c56c 100644 --- a/Disco.BI/BI/DeviceBI/Enrol.cs +++ b/Disco.BI/BI/DeviceBI/Enrol.cs @@ -7,10 +7,10 @@ using Disco.Services.Interop.ActiveDirectory; using Disco.Services.Users; using System; using System.Collections.Generic; -using System.DirectoryServices.ActiveDirectory; using System.Linq; using System.Text.RegularExpressions; using Tamir.SharpSsh; +using Exceptionless; namespace Disco.BI.DeviceBI { @@ -118,6 +118,7 @@ namespace Disco.BI.DeviceBI } catch (System.Exception ex) { + ex.ToExceptionless().Submit(); EnrolmentLog.LogSessionError(sessionId, ex); throw ex; } @@ -306,6 +307,7 @@ namespace Disco.BI.DeviceBI } catch (System.Exception ex2) { + ex2.ToExceptionless().Submit(); EnrolmentLog.LogSessionError(sessionId, ex2); throw ex2; } @@ -655,6 +657,7 @@ namespace Disco.BI.DeviceBI } catch (System.Exception ex2) { + ex2.ToExceptionless().Submit(); EnrolmentLog.LogSessionError(sessionId, ex2); throw ex2; } diff --git a/Disco.BI/BI/DocumentTemplateBI/Importer/DocumentImporterJob.cs b/Disco.BI/BI/DocumentTemplateBI/Importer/DocumentImporterJob.cs index 9584ae33..df4f9879 100644 --- a/Disco.BI/BI/DocumentTemplateBI/Importer/DocumentImporterJob.cs +++ b/Disco.BI/BI/DocumentTemplateBI/Importer/DocumentImporterJob.cs @@ -1,9 +1,10 @@ +using Disco.Data.Repository; +using Exceptionless; +using Quartz; +using Quartz.Impl.Triggers; using System; using System.IO; using System.Web.Caching; -using Disco.Data.Repository; -using Quartz; -using Quartz.Impl.Triggers; namespace Disco.BI.DocumentTemplateBI.Importer { @@ -69,8 +70,9 @@ namespace Disco.BI.DocumentTemplateBI.Importer } File.Move(filename, filenameError); } - catch + catch (Exception ex) { + ex.ToExceptionless().Submit(); // Ignore Errors } } @@ -108,6 +110,7 @@ namespace Disco.BI.DocumentTemplateBI.Importer } catch (Exception ex) { + ex.ToExceptionless().Submit(); DocumentsLog.LogImportWarning(sessionId, string.Format("{0}; Will try again in 10 Seconds", ex.Message)); // Reschedule Job for 10 seconds SimpleTriggerImpl trig = new SimpleTriggerImpl(Guid.NewGuid().ToString(), new DateTimeOffset(DateTime.Now.AddSeconds(10))); diff --git a/Disco.BI/BI/Extensions/AttachmentExtensions.cs b/Disco.BI/BI/Extensions/AttachmentExtensions.cs index d790e59d..df629521 100644 --- a/Disco.BI/BI/Extensions/AttachmentExtensions.cs +++ b/Disco.BI/BI/Extensions/AttachmentExtensions.cs @@ -1,13 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Disco.Models.Repository; +using Disco.BI.DocumentTemplateBI; using Disco.Data.Repository; -using System.IO; -using Disco.BI.DocumentTemplateBI; -using Disco.Services.Users; +using Disco.Models.Repository; using Disco.Services.Logging; +using Disco.Services.Users; +using Exceptionless; +using System; +using System.IO; namespace Disco.BI.Extensions { diff --git a/Disco.BI/BI/Extensions/DeviceExtensions.cs b/Disco.BI/BI/Extensions/DeviceExtensions.cs index d7037c95..cbb6b1e7 100644 --- a/Disco.BI/BI/Extensions/DeviceExtensions.cs +++ b/Disco.BI/BI/Extensions/DeviceExtensions.cs @@ -9,6 +9,7 @@ using System.IO; using Disco.Services.Users; using Disco.Services.Authorization; using Disco.Services.Interop.ActiveDirectory; +using Exceptionless; namespace Disco.BI.Extensions { @@ -36,6 +37,7 @@ namespace Disco.BI.Extensions } catch (Exception ex) { + ex.ToExceptionless().AddObject(deviceProfile.ComputerNameTemplate, "ComputerNameTemplate").Submit(); throw new InvalidOperationException(string.Format("An error occurred rendering the computer name: [{0}] {1}", ex.GetType().Name, ex.Message), ex.InnerException); } if (rendered == null || rendered.Length > 24) diff --git a/Disco.BI/BI/Extensions/JobActionExtensions.cs b/Disco.BI/BI/Extensions/JobActionExtensions.cs index 7147870a..afd14d77 100644 --- a/Disco.BI/BI/Extensions/JobActionExtensions.cs +++ b/Disco.BI/BI/Extensions/JobActionExtensions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Exceptionless; using Disco.Data.Repository; using Disco.Models.BI.Config; using Disco.Models.Repository; @@ -219,7 +220,7 @@ namespace Disco.BI.Extensions { DiscoServicesJobs.UpdateRecipientReference(Database, j, publishJobResult.Id, publishJobResult.Secret, j.JobMetaWarranty.ExternalReference); } - catch (Exception) { } // Ignore Errors as this is not completely necessary + catch (Exception ex) { ex.ToExceptionless().Submit(); } // Ignore Errors as this is not completely necessary } } } @@ -441,7 +442,7 @@ namespace Disco.BI.Extensions { DiscoServicesJobs.UpdateRecipientReference(Database, j, publishJobResult.Id, publishJobResult.Secret, j.JobMetaNonWarranty.RepairerReference); } - catch (Exception) { } // Ignore Errors as this is not completely necessary + catch (Exception ex) { ex.ToExceptionless().Submit(); } // Ignore Errors as this is not completely necessary } } } diff --git a/Disco.BI/Disco.BI.csproj b/Disco.BI/Disco.BI.csproj index 8e9a73ca..2b08cdcd 100644 --- a/Disco.BI/Disco.BI.csproj +++ b/Disco.BI/Disco.BI.csproj @@ -43,6 +43,14 @@ ..\packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll + + False + ..\packages\Exceptionless.1.5.2092\lib\net45\Exceptionless.dll + + + False + ..\packages\Exceptionless.1.5.2092\lib\net45\Exceptionless.Models.dll + ..\Resources\Libraries\iTextSharp\itextsharp.dll @@ -214,7 +222,7 @@ - + diff --git a/Disco.BI/packages.config b/Disco.BI/packages.config index 0bb546cb..7b1db783 100644 --- a/Disco.BI/packages.config +++ b/Disco.BI/packages.config @@ -1,6 +1,7 @@  + diff --git a/Disco.Services/Disco.Services.csproj b/Disco.Services/Disco.Services.csproj index 898c57c4..a0167281 100644 --- a/Disco.Services/Disco.Services.csproj +++ b/Disco.Services/Disco.Services.csproj @@ -39,6 +39,12 @@ ..\packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll + + ..\packages\Exceptionless.1.5.2092\lib\net45\Exceptionless.dll + + + ..\packages\Exceptionless.1.5.2092\lib\net45\Exceptionless.Models.dll + ..\packages\LumenWorks.Framework.IO.3.8.0\lib\net20\LumenWorks.Framework.IO.dll @@ -380,7 +386,7 @@ - + diff --git a/Disco.Services/Logging/SystemLog.cs b/Disco.Services/Logging/SystemLog.cs index ecca9250..a2c2ab36 100644 --- a/Disco.Services/Logging/SystemLog.cs +++ b/Disco.Services/Logging/SystemLog.cs @@ -1,8 +1,8 @@ -using System; +using Disco.Services.Logging.Models; +using Exceptionless; +using System; using System.Collections.Generic; -using System.Linq; using System.Text; -using Disco.Services.Logging.Models; namespace Disco.Services.Logging { @@ -44,6 +44,8 @@ namespace Disco.Services.Logging } public static void LogException(string Component, Exception ex) { + ex.ToExceptionless().Submit(); + // Handle Special-Case Errors if (ex is System.Data.Entity.Validation.DbEntityValidationException) { diff --git a/Disco.Services/Plugins/PluginsLog.cs b/Disco.Services/Plugins/PluginsLog.cs index bda9f2f4..3a986085 100644 --- a/Disco.Services/Plugins/PluginsLog.cs +++ b/Disco.Services/Plugins/PluginsLog.cs @@ -5,6 +5,7 @@ using System.Text; using Disco.Services.Logging; using Disco.Services.Logging.Models; using System.Reflection; +using Exceptionless; namespace Disco.Services.Plugins { @@ -123,6 +124,8 @@ namespace Disco.Services.Plugins public static void LogInitializeException(string PluginFilename, Exception ex) { + ex.ToExceptionless().AddObject(PluginFilename, "PluginFilename").Submit(); + if (ex.InnerException != null) { Log(EventTypeIds.InitializeExceptionWithInner, PluginFilename, ex.GetType().Name, ex.Message, ex.StackTrace, ex.InnerException.GetType().Name, ex.InnerException.Message, ex.InnerException.StackTrace); @@ -135,6 +138,8 @@ namespace Disco.Services.Plugins public static void LogPluginException(string Component, Exception ex) { + ex.ToExceptionless().AddObject(Component, "Component").Submit(); + if (ex.InnerException != null) { Log(EventTypeIds.PluginExceptionWithInner, Component, ex.GetType().Name, ex.Message, ex.StackTrace, ex.InnerException.GetType().Name, ex.InnerException.Message, ex.InnerException.StackTrace); diff --git a/Disco.Services/Tasks/ScheduledTask.cs b/Disco.Services/Tasks/ScheduledTask.cs index 0ca9f8bd..7ab4f83b 100644 --- a/Disco.Services/Tasks/ScheduledTask.cs +++ b/Disco.Services/Tasks/ScheduledTask.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using Disco.Data.Repository; using Quartz; -using Disco.Data.Repository; +using System; namespace Disco.Services.Tasks { diff --git a/Disco.Services/Tasks/ScheduledTasksLog.cs b/Disco.Services/Tasks/ScheduledTasksLog.cs index 007897e6..7cd0e678 100644 --- a/Disco.Services/Tasks/ScheduledTasksLog.cs +++ b/Disco.Services/Tasks/ScheduledTasksLog.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using Disco.Services.Logging; using Disco.Services.Logging.Models; +using Exceptionless; namespace Disco.Services.Tasks { @@ -54,6 +55,8 @@ namespace Disco.Services.Tasks public static void LogInitializeException(Exception ex) { + ex.ToExceptionless().Submit(); + if (ex.InnerException != null) { Log(EventTypeIds.InitializeExceptionWithInner, ex.GetType().Name, ex.Message, ex.StackTrace, ex.InnerException.GetType().Name, ex.InnerException.Message, ex.InnerException.StackTrace); @@ -65,6 +68,8 @@ namespace Disco.Services.Tasks } public static void LogInitializeException(Exception ex, Type ScheduledTaskType) { + ex.ToExceptionless().Submit(); + if (ex.InnerException != null) { Log(EventTypeIds.InitializeScheduledTasksExceptionWithInner, ScheduledTaskType.Name, ScheduledTaskType.Assembly.Location, ex.GetType().Name, ex.Message, ex.StackTrace, ex.InnerException.GetType().Name, ex.InnerException.Message, ex.InnerException.StackTrace); @@ -77,6 +82,12 @@ namespace Disco.Services.Tasks public static void LogScheduledTaskException(string ScheduledTaskName, string SessionId, Type ScheduledTaskType, Exception ex) { + ex.ToExceptionless() + .AddTags("Scheduled Task") + .AddObject(ScheduledTaskName, "ScheduledTaskName") + .AddObject(ScheduledTaskType.Name, "ScheduledTaskTypeName") + .Submit(); + if (ex.InnerException != null) { Log(EventTypeIds.ScheduledTasksExceptionWithInner, ScheduledTaskName, SessionId, ScheduledTaskType.Assembly.Location, ex.GetType().Name, ex.Message, ex.StackTrace, ex.InnerException.GetType().Name, ex.InnerException.Message, ex.InnerException.StackTrace); diff --git a/Disco.Services/packages.config b/Disco.Services/packages.config index c8df00dc..6badf0aa 100644 --- a/Disco.Services/packages.config +++ b/Disco.Services/packages.config @@ -1,6 +1,7 @@  + diff --git a/Disco.Web/App_Start/AppConfig.cs b/Disco.Web/App_Start/AppConfig.cs index a9b776b5..990a4e10 100644 --- a/Disco.Web/App_Start/AppConfig.cs +++ b/Disco.Web/App_Start/AppConfig.cs @@ -1,9 +1,13 @@ using Disco.Data.Repository; using Disco.Services.Interop.DiscoServices; +using Exceptionless; +using Exceptionless.Configuration; using System; using System.Linq; using System.Web; +[assembly: Exceptionless("https://errors.discoict.com.au", "c81e644582374f68aaf1fb546e3db0cd")] + namespace Disco.Web { public static class AppConfig @@ -27,16 +31,19 @@ namespace Disco.Web public static void InitalizeCoreEnvironment(DiscoDataContext Database) { + ExceptionlessClient.Current.SendingError += Exceptionless_SendingError; + // Initialize Logging Disco.Services.Logging.LogContext.Initalize(Database, DiscoApplication.SchedulerFactory); - // Initialize Active Directory Interop - Disco.Services.Interop.ActiveDirectory.ActiveDirectory.Initialize(Database); - // Load Organisation Name + DiscoApplication.DeploymentId = Database.DiscoConfiguration.DeploymentId; DiscoApplication.OrganisationName = Database.DiscoConfiguration.OrganisationName; DiscoApplication.MultiSiteMode = Database.DiscoConfiguration.MultiSiteMode; + // Initialize Active Directory Interop + Disco.Services.Interop.ActiveDirectory.ActiveDirectory.Initialize(Database); + // Setup Global Proxy DiscoApplication.SetGlobalProxy(Database.DiscoConfiguration.ProxyAddress, Database.DiscoConfiguration.ProxyPort, @@ -47,6 +54,14 @@ namespace Disco.Web Disco.Services.Users.UserService.Initialize(Database); } + static void Exceptionless_SendingError(object sender, ErrorModelEventArgs e) + { + e.Error.UserName = DiscoApplication.DeploymentId; + e.Error.UserDescription = DiscoApplication.OrganisationName; + + e.Error.Tags.Add(string.Concat("v", DiscoApplication.Version)); + } + public static void InitalizeNormalEnvironment(DiscoDataContext Database) { InitalizeCoreEnvironment(Database); diff --git a/Disco.Web/Controllers/JobController.cs b/Disco.Web/Controllers/JobController.cs index bba7c3e2..5331c648 100644 --- a/Disco.Web/Controllers/JobController.cs +++ b/Disco.Web/Controllers/JobController.cs @@ -12,6 +12,7 @@ using Disco.Services.Plugins.Features.UIExtension; using Disco.Services.Plugins.Features.WarrantyProvider; using Disco.Services.Users; using Disco.Services.Web; +using Exceptionless; using Newtonsoft.Json; using System; using System.Collections.Generic; @@ -544,6 +545,7 @@ namespace Disco.Web.Controllers } catch (Exception ex) { + ex.ToExceptionless().Submit(); m.Error = ex; return View(Views.LogWarrantyError, m); throw; @@ -558,6 +560,7 @@ namespace Disco.Web.Controllers } catch (Exception ex) { + ex.ToExceptionless().Submit(); m.Error = ex; return View(Views.LogWarrantyError, m); } @@ -580,6 +583,7 @@ namespace Disco.Web.Controllers } catch (Exception ex) { + ex.ToExceptionless().Submit(); m.Error = ex; return View(Views.LogWarrantyError, m); throw; @@ -624,6 +628,7 @@ namespace Disco.Web.Controllers } catch (Exception ex) { + ex.ToExceptionless().Submit(); model.JobDetailsSupported = false; model.JobDetailsException = ex; return View(model); @@ -726,6 +731,7 @@ namespace Disco.Web.Controllers } catch (Exception ex) { + ex.ToExceptionless().Submit(); m.Error = ex; return View(Views.LogRepairError, m); throw; @@ -740,6 +746,7 @@ namespace Disco.Web.Controllers } catch (Exception ex) { + ex.ToExceptionless().Submit(); m.Error = ex; return View(Views.LogRepairError, m); } @@ -762,6 +769,7 @@ namespace Disco.Web.Controllers } catch (Exception ex) { + ex.ToExceptionless().Submit(); m.Error = ex; return View(Views.LogRepairError, m); throw; @@ -806,6 +814,7 @@ namespace Disco.Web.Controllers } catch (Exception ex) { + ex.ToExceptionless().Submit(); model.JobDetailsSupported = false; model.JobDetailsException = ex; return View(model); diff --git a/Disco.Web/Disco.Web.csproj b/Disco.Web/Disco.Web.csproj index 00e72ff8..a8453235 100644 --- a/Disco.Web/Disco.Web.csproj +++ b/Disco.Web/Disco.Web.csproj @@ -43,6 +43,15 @@ true + + ..\packages\Exceptionless.1.5.2092\lib\net45\Exceptionless.dll + + + ..\packages\Exceptionless.1.5.2092\lib\net45\Exceptionless.Models.dll + + + ..\packages\Exceptionless.Mvc.1.5.2092\lib\net45\Exceptionless.Mvc.dll + ..\packages\MarkdownSharp.1.13.0.0\lib\35\MarkdownSharp.dll @@ -2387,7 +2396,7 @@ False - + diff --git a/Disco.Web/Global.asax.cs b/Disco.Web/Global.asax.cs index b3d84258..2a763368 100644 --- a/Disco.Web/Global.asax.cs +++ b/Disco.Web/Global.asax.cs @@ -145,6 +145,9 @@ namespace Disco.Web _OrganisationName = value; } } + + public static string DeploymentId { get; set; } + public static bool MultiSiteMode { get; set; } #region Version diff --git a/Disco.Web/Web.config b/Disco.Web/Web.config index 2eb71a58..c519f5e2 100644 --- a/Disco.Web/Web.config +++ b/Disco.Web/Web.config @@ -37,7 +37,9 @@ - + + + diff --git a/Disco.Web/packages.config b/Disco.Web/packages.config index d8dd99ae..41178105 100644 --- a/Disco.Web/packages.config +++ b/Disco.Web/packages.config @@ -3,6 +3,8 @@ + +