Example #1
0
        public void LogException(int nLevel, string strSource, string strMessage, string exception)
        {
            try
            {
                var logentry = new HFDServiceLog
                {
                    Level         = nLevel,
                    Source        = strSource.Clip(50),
                    Message       = strMessage.Clip(200),
                    ExceptionText = exception,
                    LoggedDT      = DateTime.Now
                };

                this.HFDServiceLogs.Add(logentry);
                this.SaveChanges();
            }
            catch
            {
            }
        }
        public void LogException(int nLevel, string strSource, string strMessage, Exception exception)
        {
            try
            {
                var logentry = new HFDServiceLog
                {
                    Level = nLevel,
                    Source = strSource.Clip(50),
                    Message = strMessage.Clip(200),
                    ExceptionText = exception.ToString(),
                    LoggedDT = DateTime.Now
                };

                this.HFDServiceLogs.Add(logentry);
                this.SaveChanges();
            }
            catch
            {
            }
        }