//SaveLog to DB; public void Start(string service, string method, string param) { sp.Start(); _auditInfo = new AuditInfo { UserId = _session.UserId, ServiceName = service, MethodName = method, RequestJson = param, ExecutionTime = DateTime.Now }; provider.Fill(_auditInfo); }
public void Fill(AuditInfo auditInfo) { var httpContext = HttpContext.Current ?? _httpContext; if (httpContext == null) { return; } try { auditInfo.BrowserInfo = GetBrowserInfo(httpContext); auditInfo.ClientIpAddress = GetClientIpAddress(httpContext); auditInfo.ClientName = GetComputerName(httpContext); } catch (Exception ex) { Logger.Warn("Could not obtain web parameters for audit info."); Logger.Warn(ex.ToString(), ex); } }