public StaticServiceResolveInitialization(ILoggingServiceProvider loggingServiceProvider)
 {
     if (loggingServiceProvider == null)
     {
         throw new ArgumentNullException(nameof(loggingServiceProvider));
     }
     Logging.Core.StaticServiceResolver.SetResolver(loggingServiceProvider);
 }
Esempio n. 2
0
 /// <summary>
 /// Create a new instance of <see cref="MicrosoftLoggerWrapper"/>
 /// </summary>
 /// <param name="loggerServiceProvider"></param>
 /// <param name="categoryName"></param>
 /// <exception cref="ArgumentNullException"></exception>
 public MicrosoftLoggerWrapper(ILoggingServiceProvider loggerServiceProvider, string categoryName)
 {
     if (loggerServiceProvider == null)
     {
         throw new ArgumentNullException(nameof(loggerServiceProvider));
     }
     _logger = loggerServiceProvider.GetLogger(categoryName);
 }
Esempio n. 3
0
 /// <inheritdoc />
 public PostgreSqlLoggerProxy(ILoggingServiceProvider loggingServiceProvider, string categoryName)
 {
     if (loggingServiceProvider is null)
     {
         throw new ArgumentNullException(nameof(loggingServiceProvider));
     }
     _logger       = loggingServiceProvider.GetLogger(categoryName);
     _minimumLevel = _logger.MinimumLevel;
 }
 public StaticServiceResolveInitialization(ILoggingServiceProvider loggingServiceProvider, Action additionalAction = null)
 {
     if (loggingServiceProvider is null)
     {
         throw new ArgumentNullException(nameof(loggingServiceProvider));
     }
     StaticServiceResolver.SetResolver(loggingServiceProvider);
     additionalAction?.Invoke();
 }
Esempio n. 5
0
 public static void SetResolver(ILoggingServiceProvider loggingServiceProvider)
 {
     if (loggingServiceProvider == null)
     {
         throw new ArgumentNullException(nameof(loggingServiceProvider));
     }
     if (_loggingServiceProvider == null)
     {
         _loggingServiceProvider = loggingServiceProvider;
     }
 }
 public StaticServiceResolveInitialization(ILoggingServiceProvider loggingServiceProvider, NhSinkOptions settings)
 {
     if (loggingServiceProvider == null)
     {
         throw new ArgumentNullException(nameof(loggingServiceProvider));
     }
     if (settings == null)
     {
         throw new ArgumentNullException(nameof(settings));
     }
     Logging.Core.StaticServiceResolver.SetResolver(loggingServiceProvider);
     global::NHibernate.LoggerProvider.SetLoggersFactory(
         new NHibernateLoggerWrapperFactory(loggingServiceProvider, settings.GetRenderingOptions(), settings.Filter));
 }
        /// <summary>
        /// Use Cosmos Logging for EntityFrameworkCore
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="loggingServiceProvider"></param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException"></exception>
        public static DbContextOptionsBuilder UseCosmosLogging(
            this DbContextOptionsBuilder builder, ILoggingServiceProvider loggingServiceProvider)
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            var loggerFactory = new LoggerFactory();

            loggerFactory.AddProvider(new EfCoreLoggerWrapperProvider(loggingServiceProvider, UpstreamRenderingOptions));
            builder.UseLoggerFactory(loggerFactory);

            return(builder);
        }
Esempio n. 8
0
        /// <summary>
        /// Add Cosmos support
        /// </summary>
        /// <param name="factory"></param>
        /// <param name="loggingServiceProvider"></param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException"></exception>
        public static ILoggerFactory AddCosmos(this ILoggerFactory factory, ILoggingServiceProvider loggingServiceProvider)
        {
            if (factory is null)
            {
                throw new ArgumentNullException(nameof(factory));
            }
            if (loggingServiceProvider is null)
            {
                throw new ArgumentNullException(nameof(loggingServiceProvider));
            }

            factory.AddProvider(new MicrosoftLoggerWrapperProvider(loggingServiceProvider));

            return(factory);
        }
        /// <summary>
        /// Use Cosmos Logging for EntityFrameworkCore
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="loggingServiceProvider"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException"></exception>
        public static DbContextOptionsBuilder UseCosmosLogging(
            this DbContextOptionsBuilder builder, ILoggingServiceProvider loggingServiceProvider, Func <string, LogLevel, bool> filter)
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            var loggerFactory = new LoggerFactory();

            loggerFactory.AddProvider(new EfCoreLoggerWrapperProvider(loggingServiceProvider, UpstreamRenderingOptions,
                                                                      (s, l) => (_globalFilter?.Invoke(s, l) ?? true) && (filter?.Invoke(s, LogLevelSwitcher.Switch(l)) ?? true)));
            builder.UseLoggerFactory(loggerFactory);

            return(builder);
        }
Esempio n. 10
0
 public SqlSugarInterceptorDescriptor(ILoggingServiceProvider loggingServiceProvider, IOptions <SqlSugarOptions> settings)
 {
     _loggingServiceProvider = loggingServiceProvider ?? throw new ArgumentNullException(nameof(loggingServiceProvider));
     _settings = settings?.Value;
 }
 /// <inheritdoc />
 public MicrosoftLoggerAdapter(ILoggingServiceProvider loggerServiceProvider) : base(loggerServiceProvider?.GetLogger <T>())
 {
 }
 /// <inheritdoc />
 public NHibernateLoggerWrapperFactory(ILoggingServiceProvider loggingServiceProvider, RenderingConfiguration renderingOptions)
     : this(loggingServiceProvider, renderingOptions, TrueFilter)
 {
 }
 /// <inheritdoc />
 public NHibernateLoggerWrapperFactory(ILoggingServiceProvider loggingServiceProvider, RenderingConfiguration renderingOptions, Func <string, LogEventLevel, bool> filter)
 {
     _loggingServiceProvider = loggingServiceProvider ?? throw new ArgumentNullException(nameof(loggingServiceProvider));
     _renderingOptions       = renderingOptions ?? new RenderingConfiguration();
     _filter = filter ?? TrueFilter;
 }
Esempio n. 14
0
 public NHibernateLoggerWrapperFactory(ILoggingServiceProvider loggingServiceProvider, RendingConfiguration renderingOptions)
 {
     _loggingServiceProvider = loggingServiceProvider ?? throw new ArgumentNullException(nameof(loggingServiceProvider));
     _renderingOptions       = renderingOptions ?? new RendingConfiguration();
     _filter = TrueFilter;
 }
Esempio n. 15
0
 public EfCoreLoggerWrapperProvider(ILoggingServiceProvider loggingServiceProvider, RendingConfiguration renderingOptions, Func <string, LogLevel, bool> filter)
 {
     _loggingServiceProvider   = loggingServiceProvider ?? throw new ArgumentNullException(nameof(loggingServiceProvider));
     _upstreamRenderingOptions = renderingOptions ?? new RendingConfiguration();
     _filter = As(filter) ?? trueFilter;
 }
Esempio n. 16
0
 public EfCoreLoggerWrapperProvider(ILoggingServiceProvider loggingServiceProvider, RenderingConfiguration renderingOptions)
 {
     _loggingServiceProvider   = loggingServiceProvider ?? throw new ArgumentNullException(nameof(loggingServiceProvider));
     _upstreamRenderingOptions = renderingOptions ?? new RenderingConfiguration();
     _filter = TrueFilter;
 }
 /// <inheritdoc />
 public AspNetCoreLoggerWrapper(ILoggingServiceProvider provider) : base(provider?.GetLogger <T>())
 {
 }
Esempio n. 18
0
 /// <summary>
 /// Create a new instance of <see cref="AspNetCoreLoggerFactory"/>
 /// </summary>
 /// <param name="loggingServiceProvider"></param>
 public AspNetCoreLoggerFactory(ILoggingServiceProvider loggingServiceProvider)
 {
     _loggingServiceProvider = loggingServiceProvider ?? throw new ArgumentNullException(nameof(loggingServiceProvider));
 }
 /// <inheritdoc />
 public NpgsqlLogActivation(ILoggingServiceProvider loggingServiceProvider, IOptions <PostgresEnricherOptions> settings)
 {
     _loggingServiceProvider = loggingServiceProvider ?? throw new ArgumentNullException(nameof(loggingServiceProvider));
     _options = settings?.Value ?? throw new ArgumentNullException(nameof(settings));
 }
Esempio n. 20
0
 public MicrosoftLoggerWrapperProvider(ILoggingServiceProvider loggingServiceProvider, Func <string, LogLevel, bool> filter)
 {
     _loggingServiceProvider = loggingServiceProvider ?? throw new ArgumentNullException(nameof(loggingServiceProvider));
     _filter = As(filter) ?? trueFilter;
 }
Esempio n. 21
0
 public MicrosoftLoggerWrapperProvider(ILoggingServiceProvider loggingServiceProvider)
 {
     _loggingServiceProvider = loggingServiceProvider ?? throw new ArgumentNullException(nameof(loggingServiceProvider));
 }
 /// <inheritdoc />
 public PostgreSqlLoggerProxyProvider(ILoggingServiceProvider loggingServiceProvider)
 {
     _loggingServiceProvider = loggingServiceProvider ?? throw new ArgumentNullException(nameof(loggingServiceProvider));
 }
Esempio n. 23
0
 /// <inheritdoc />
 public AspNetCoreLoggerWrapper(ILoggingServiceProvider loggerServiceProvider, string categoryName) : base(loggerServiceProvider, categoryName)
 {
 }
 /// <summary>
 /// Create a new instance of <see cref="MicrosoftLoggerProviderAdapter"/>.
 /// </summary>
 /// <param name="loggingServiceProvider"></param>
 /// <param name="filter"></param>
 public MicrosoftLoggerProviderAdapter(ILoggingServiceProvider loggingServiceProvider, Func <string, LogEventLevel, bool> filter)
 {
     _loggingServiceProvider = loggingServiceProvider ?? throw new ArgumentNullException(nameof(loggingServiceProvider));
     _filter = filter ?? TrueFilter;
 }
 /// <inheritdoc />
 public FreeSqlInterceptorDescriptor(ILoggingServiceProvider loggingServiceProvider, IOptions <FreeSqlEnricherOptions> settings)
 {
     _loggingServiceProvider = loggingServiceProvider;
     _settings = settings?.Value;
 }
Esempio n. 26
0
 /// <inheritdoc />
 public PostgreSqlLoggerProxy(ILoggingServiceProvider loggerServiceProvider) : base(loggerServiceProvider?.GetLogger <T>())
 {
 }
Esempio n. 27
0
 internal EfIntegrationLoggerInterceptor(EfInterceptorDescriptor descriptor)
 {
     _descriptor             = descriptor ?? throw new ArgumentNullException(nameof(descriptor));
     _loggingServiceProvider = descriptor.ExposeLoggingServiceProvider;
 }
Esempio n. 28
0
 public HomeController(ILoggingServiceProvider loggingProvider)
 {
     _loggingProvider = loggingProvider ?? throw new ArgumentNullException(nameof(loggingProvider));
 }