示例#1
0
        public static void WriteDebugLog(string log)
        {
            ILoggingRepository logRepository = new LoggingRepository();

            logRepository.Add(new Logging()
            {
                CreatedDate = DateTime.Now,
                Message     = log,
                Type        = Convert.ToString((int)LogType.Debug)
            });
            logRepository.Save();
        }
示例#2
0
        public static void WriteExceptionLog(Exception ex)
        {
            ILoggingRepository logRepository = new LoggingRepository();

            logRepository.Add(new Logging()
            {
                CreatedDate           = DateTime.Now,
                ExceptionMessage      = ex.Message,
                InnerExceptionMessage = ex.InnerException.Message,
                LineNumber            = GetLineNumber(ex),
                MethodName            = GetMethodName(ex),
                Type = Convert.ToString((int)LogType.Debug)
            });
            logRepository.Save();
        }