Exemplo n.º 1
0
        public static HttpLoggingBuilder AddHttpLogging(this RaccoonLogBuilder builder,
                                                        Action <RaccoonLogHttpOptions> configureOptions)
        {
            var services = builder.Services;

            services.Configure(configureOptions);

            services.AddHttpContextAccessor();

            services.AddScoped <IDataProtector, DataProtector>();

            services.AddScoped <IHttpLoggingProvider, HttpLoggingProvider>();
            services.AddScoped <IHttpLogMessageFactory, HttpLogMessageFactory>();

            services.AddScoped <IHttpLoggingStore, DefaultHttpLoggingStore>();

            // handlers

            services.AddScoped <IHttpRequestLogFormHandler, DefaultHttpRequestLogFormHandler>();
            services.AddScoped <IHttpMessageLogTraceIdHandler, DefaultHttpMessageLogTraceIdHandler>();

            services.AddScoped <IHttpRequestLogHandler, DefaultHttpRequestLogHandler>();
            services.AddScoped <IHttpResponseLogHandler, DefaultHttpResponseLogHandler>();
            services.AddScoped <IHttpRequestLogBodyHandler, DefaultHttpRequestLogBodyHandler>();
            services.AddScoped <IHttpResponseLogBodyHandler, DefaultHttpResponseLogBodyHandler>();

            return(new HttpLoggingBuilder(services));
        }
Exemplo n.º 2
0
 public static HttpLoggingBuilder AddHttpLogging(this RaccoonLogBuilder builder)
 {
     return(builder.AddHttpLogging(o => { }));
 }