Пример #1
0
 public ApiRequestLogger(Assembly parentApplication, string applicationLoggingId, ILogFrameworkAgent frameworkLogger, ApiLogVerbosity apiLogVerbosity) : base(parentApplication,
                                                                                                                                                              LoggingMessageTypes.RequestResponse.ToString(), applicationLoggingId, frameworkLogger)
 {
     LogDurationInPushes = true;
     _apiLogVerbosity    = apiLogVerbosity;
 }
Пример #2
0
        public static void AddApiLoggingServices(this IServiceCollection services, Assembly parentApplication, string applicationLogginId, ApiLogVerbosity apiLogVerbosity)
        {
            var serviceProvider = services.BuildServiceProvider();

            services.AddScoped <IApiRequestLogger, ApiRequestLogger>((ctx) =>
            {
                return(new ApiRequestLogger(parentApplication, applicationLogginId, serviceProvider.GetService <ILogFrameworkAgent>(), apiLogVerbosity));
            });
        }