| | |
| | | string responseParam = string.Empty; |
| | | try |
| | | { |
| | | string? apiIgnore = AppSettings.GetValue("ApiLogIgnore")?.ToString(); |
| | | string[] ignoreUrls = !string.IsNullOrEmpty(apiIgnore) ? apiIgnore.Split(",") : new string[] { "get" }; |
| | | |
| | | (context.RequestServices.GetService(typeof(RequestLogModel)) as RequestLogModel).RequestDate = DateTime.Now; |
| | | try |
| | | { |
| | |
| | | |
| | | ms.Position = 0; |
| | | await ms.CopyToAsync(originalBody); |
| | | if (!(context.Request.Path.Value?.Contains("Get") ?? false)) |
| | | |
| | | if (!ignoreUrls.Any(x => context.Request.Path.Value?.ToLower().Contains(x.ToLower()) ?? false)) |
| | | { |
| | | Logger.Add(requestParam, responseParam); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |