public EnterpriseLoggerProvider(
     DispatchService dispatchService,
     IOptions <EnterpriseLogOptions> options)
 {
     _dispatchService = dispatchService;
     _options         = options.Value;
 }
 public EnterpriseLogger(
     string name,
     DispatchService dispatchService,
     EnterpriseLogOptions options)
 {
     _name            = name;
     _dispatchService = dispatchService;
     _options         = options;
 }
 public EnterpriseLogMiddleware(
     RequestDelegate next,
     DispatchService dispatchService,
     EnterpriseLogOptions options)
 {
     _next            = next;
     _dispatchService = dispatchService;
     _options         = options;
 }
        public static void AddLoggingConfiguration(this IServiceCollection services, IConfiguration configuration)
        {
            if (services == null)
            {
                throw new ArgumentNullException(nameof(services));
            }

            // Retornar caso o log estiver desabilitado
            if (bool.TryParse(configuration["Logging:EnterpriseLog:Disabled"] ?? "false", out var disabled) && disabled)
            {
                return;
            }

            EnterpriseLogOptions.HeadersIgnore = new string[] { "Authorization" };

            var logConfiguration = new EnterpriseLogOptions();

            configuration.Bind("Logging:EnterpriseLog", logConfiguration);
            services.AddSingleton(logConfiguration);

            services.AddEnterpriseLog(configuration);
        }