public StaticServiceResolveInitialization(ILoggingServiceProvider loggingServiceProvider) { if (loggingServiceProvider == null) { throw new ArgumentNullException(nameof(loggingServiceProvider)); } Logging.Core.StaticServiceResolver.SetResolver(loggingServiceProvider); }
/// <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); }
/// <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(); }
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); }
/// <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); }
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; }
public NHibernateLoggerWrapperFactory(ILoggingServiceProvider loggingServiceProvider, RendingConfiguration renderingOptions) { _loggingServiceProvider = loggingServiceProvider ?? throw new ArgumentNullException(nameof(loggingServiceProvider)); _renderingOptions = renderingOptions ?? new RendingConfiguration(); _filter = TrueFilter; }
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; }
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>()) { }
/// <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)); }
public MicrosoftLoggerWrapperProvider(ILoggingServiceProvider loggingServiceProvider, Func <string, LogLevel, bool> filter) { _loggingServiceProvider = loggingServiceProvider ?? throw new ArgumentNullException(nameof(loggingServiceProvider)); _filter = As(filter) ?? trueFilter; }
public MicrosoftLoggerWrapperProvider(ILoggingServiceProvider loggingServiceProvider) { _loggingServiceProvider = loggingServiceProvider ?? throw new ArgumentNullException(nameof(loggingServiceProvider)); }
/// <inheritdoc /> public PostgreSqlLoggerProxyProvider(ILoggingServiceProvider loggingServiceProvider) { _loggingServiceProvider = loggingServiceProvider ?? throw new ArgumentNullException(nameof(loggingServiceProvider)); }
/// <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; }
/// <inheritdoc /> public PostgreSqlLoggerProxy(ILoggingServiceProvider loggerServiceProvider) : base(loggerServiceProvider?.GetLogger <T>()) { }
internal EfIntegrationLoggerInterceptor(EfInterceptorDescriptor descriptor) { _descriptor = descriptor ?? throw new ArgumentNullException(nameof(descriptor)); _loggingServiceProvider = descriptor.ExposeLoggingServiceProvider; }
public HomeController(ILoggingServiceProvider loggingProvider) { _loggingProvider = loggingProvider ?? throw new ArgumentNullException(nameof(loggingProvider)); }