public MetricsDelegatingHandler(IMetricsService metricsService, XpikeHttpClientFactoryOptions factoryOptions) { this.metricsService = metricsService; this.factoryOptions = factoryOptions; prefix = $"{factoryOptions.CommandGroup}.{factoryOptions.CommandName}"; }
public LoggingDelegatingHandler(ILogService logger, XpikeHttpClientFactoryOptions factoryOptions, string category = LogServiceDefaults.DEFAULT_CATEGORY) { this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); if (string.IsNullOrWhiteSpace(category)) { this.category = LogServiceDefaults.DEFAULT_CATEGORY; } else { this.category = category; } this.factoryOptions = factoryOptions ?? throw new ArgumentNullException(nameof(factoryOptions)); if (factoryOptions.Treat4xxAsErrorsWhenLogging) { this.lowestError = HttpStatusCode.BadRequest; } else { this.lowestError = HttpStatusCode.InternalServerError; } }