2019-11-04 00:26:23 +02:00
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2023-01-12 01:01:36 +02:00
|
|
|
|
using Netmash.Logging.Api.Entities;
|
2019-11-04 00:26:23 +02:00
|
|
|
|
|
2023-01-12 01:01:36 +02:00
|
|
|
|
namespace Netmash.Logging.Api
|
2019-11-04 00:26:23 +02:00
|
|
|
|
{
|
|
|
|
|
public static class DependencyInjectionExtensions
|
|
|
|
|
{
|
|
|
|
|
public static void AddRequestLogging(this IServiceCollection services)
|
|
|
|
|
{
|
2019-11-05 12:43:44 +02:00
|
|
|
|
services.AddSingleton(new RequestLoggingConfiguration() { LogBody = false });
|
|
|
|
|
services.AddScoped<RequestLoggingAttribute>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void AddRequestLogging(this IServiceCollection services, bool logBody)
|
|
|
|
|
{
|
|
|
|
|
services.AddSingleton(new RequestLoggingConfiguration() { LogBody = logBody });
|
2019-11-04 00:26:23 +02:00
|
|
|
|
services.AddScoped<RequestLoggingAttribute>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|