private void Save( ErrorLog entity ) { Contract.Requires( entity.UserId != null ); _standardUnitOfWork.ErrorLogRepository.Insert( entity ); _standardUnitOfWork.Save(); }
public void Log( ErrorLog errorLog ) { errorLog.ErrorDate = DateTime.Now; errorLog.UserId = _userId; errorLog.HostIP = _hostIP; errorLog.ClientIP = _clientIP; Save( errorLog ); }
public void Log( Exception exception, string category = null ) { var errorLog = new ErrorLog { ErrorCategory = category, ExceptionType = exception.GetType().FullName, Message = exception.Message, BaseMessage = exception.GetBaseException().Message, StackTrace = exception.StackTrace }; Log( errorLog ); }