protected void Application_Error(object sender, EventArgs e)
        {
            Exception      exception         = Server.GetLastError();
            DataAccessBase objDataAccessBase = new DataAccessBase();

            Log.Error(JsonConvert.SerializeObject(exception));
            objDataAccessBase.LogError(exception);
        }
Example #2
0
        protected void Application_Error(object sender, EventArgs e)
        {
            Exception      ex = Server.GetLastError();
            DataAccessBase objDataAccessBase = new DataAccessBase();
            var            error             = new OMC.Models.ErrorLog
            {
                Message       = ex.Message,
                ExceptionType = ex.GetType().ToString(),
                Source        = ex.Source,
                StackTrace    = ex.StackTrace,
            };

            Log.Error(JsonConvert.SerializeObject(error));
            objDataAccessBase.LogError(error);
        }