public CosmosDatabaseWrapper( DatabaseDependencies dependencies, CosmosClientWrapper cosmosClient, ILoggingOptions loggingOptions) : base(dependencies) { _cosmosClient = cosmosClient; if (loggingOptions.IsSensitiveDataLoggingEnabled) { _sensitiveLoggingEnabled = true; } }
/// <summary> /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to /// the same compatibility standards as public APIs. It may be changed or removed without notice in /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// </summary> public RelationalConnectionDiagnosticsLogger( ILoggerFactory loggerFactory, ILoggingOptions loggingOptions, DiagnosticSource diagnosticSource, LoggingDefinitions loggingDefinitions, IDbContextLogger contextLogger, IDbContextOptions contextOptions, IInterceptors?interceptors = null) : base(loggerFactory, loggingOptions, diagnosticSource, loggingDefinitions, contextLogger, interceptors) { _loggingConfigCacheTime = contextOptions.FindExtension <CoreOptionsExtension>()?.LoggingConfigCacheTime ?? CoreOptionsExtension.DefaultLoggingConfigCacheTime; }
public ThrowingMonsterStateManager( IInternalEntityEntryFactory factory, IInternalEntityEntrySubscriber subscriber, IInternalEntityEntryNotifier notifier, IValueGenerationManager valueGeneration, IModel model, IDatabase database, IConcurrencyDetector concurrencyDetector, ICurrentDbContext currentContext, ILoggingOptions loggingOptions, IDiagnosticsLogger <DbLoggerCategory.Update> updateLogger) : base(factory, subscriber, notifier, valueGeneration, model, database, concurrencyDetector, currentContext, loggingOptions, updateLogger) { }
internal AutofacServiceCollection(ContainerBuilder services, IConfigurationRoot root) { _configurationBuilder = root is null ? new LoggingConfigurationBuilder() : new DisabledConfigurationBuilder(root); _configurationBuilderLockedStatus = root != null; _services = new AutofacProxyRegister(services); _settings = new LoggingOptions(); _sinkSettings = new Dictionary <string, ILoggingSinkOptions>(); _additionalEnricherProviders = new List <Func <ILogEventEnricher> >(); BeGivenConfigurationBuilder = _configurationBuilder.InitializedByGivenBuilder; BeGivenConfigurationRoot = root != null; }
internal StandardLogServiceCollection(IServiceCollection services, IConfigurationRoot root) { _configurationBuilder = root is null ? new LoggingConfigurationBuilder() : new DisabledConfigurationBuilder(root); _configurationBuilderLockedStatus = root != null; _services = new MicrosoftProxyRegister(services ?? throw new ArgumentNullException(nameof(services))); _settings = new LoggingOptions(); _sinkSettings = new Dictionary <string, ILoggingSinkOptions>(); _additionalEnricherProviders = new List <Func <ILogEventEnricher> >(); BeGivenConfigurationBuilder = _configurationBuilder.InitializedByGivenBuilder; BeGivenConfigurationRoot = root != null; }
/// <summary> /// Clones this dependency parameter object with one service replaced. /// </summary> /// <param name="loggingOptions"> A replacement for the current dependency of this type. </param> /// <returns> A new parameter object with the given service replaced. </returns> public StateManagerDependencies With([NotNull] ILoggingOptions loggingOptions) => new StateManagerDependencies( InternalEntityEntryFactory, InternalEntityEntrySubscriber, InternalEntityEntryNotifier, ValueGenerationManager, Model, Database, ConcurrencyDetector, CurrentContext, EntityFinderSource, SetSource, EntityMaterializerSource, loggingOptions, UpdateLogger);
private static void RegisterLogger(IServiceCollection serviceCollection, ILoggingOptions loggingOptions, IConfiguration configuration) { const string applicationInsightsEnvironmentVariable = "APPINSIGHTS_INSTRUMENTATIONKEY"; var appInsightsInstrumentationKey = configuration[applicationInsightsEnvironmentVariable]; GlobalLoggerConfiguration.ConfigureLogger(loggingOptions, appInsightsInstrumentationKey); serviceCollection.AddSingleton(x => Log.Logger); // must be func, as the static logger is configured (changed reference) after DI registering serviceCollection.AddSingleton <ILoggerAdapter, SerilogLoggerAdapter>(); if (!string.IsNullOrEmpty(appInsightsInstrumentationKey)) { serviceCollection.AddApplicationInsightsTelemetry(); } }
/// <summary> /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to /// the same compatibility standards as public APIs. It may be changed or removed without notice in /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// </summary> public DiagnosticsLogger( [NotNull] ILoggerFactory loggerFactory, [NotNull] ILoggingOptions loggingOptions, [NotNull] DiagnosticSource diagnosticSource, [NotNull] LoggingDefinitions loggingDefinitions, [NotNull] IDbContextLogger contextLogger, [CanBeNull] IInterceptors interceptors = null) { DiagnosticSource = diagnosticSource; Definitions = loggingDefinitions; DbContextLogger = contextLogger; Logger = loggerFactory.CreateLogger(new TLoggerCategory()); Options = loggingOptions; Interceptors = interceptors; }
/// <summary> /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to /// the same compatibility standards as public APIs. It may be changed or removed without notice in /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// </summary> public DiagnosticsLogger( ILoggerFactory loggerFactory, ILoggingOptions loggingOptions, DiagnosticSource diagnosticSource, LoggingDefinitions loggingDefinitions, IDbContextLogger contextLogger, IInterceptors?interceptors = null) { DiagnosticSource = diagnosticSource; Definitions = loggingDefinitions; DbContextLogger = contextLogger; Logger = loggerFactory.CreateLogger(new TLoggerCategory()); Options = loggingOptions; Interceptors = interceptors; }
/// <summary> /// <para> /// Creates the service dependencies parameter object for a <see cref="CommandBatchPreparer" />. /// </para> /// <para> /// This API supports the Entity Framework Core infrastructure and is not intended to be used /// directly from your code. This API may change or be removed in future releases. /// </para> /// <para> /// Do not call this constructor directly from either provider or application code as it may change /// as new dependencies are added. Instead, use this type in your constructor so that an instance /// will be created and injected automatically by the dependency injection container. To create /// an instance with some dependent services replaced, first resolve the object from the dependency /// injection container, then replace selected services using the 'With...' methods. Do not call /// the constructor at any point in this process. /// </para> /// </summary> public CommandBatchPreparerDependencies( [NotNull] IModificationCommandBatchFactory modificationCommandBatchFactory, [NotNull] IParameterNameGeneratorFactory parameterNameGeneratorFactory, [NotNull] IComparer <ModificationCommand> modificationCommandComparer, [NotNull] IKeyValueIndexFactorySource keyValueIndexFactorySource, [NotNull] Func <IStateManager> stateManager, [NotNull] ILoggingOptions loggingOptions) { ModificationCommandBatchFactory = modificationCommandBatchFactory; ParameterNameGeneratorFactory = parameterNameGeneratorFactory; ModificationCommandComparer = modificationCommandComparer; KeyValueIndexFactorySource = keyValueIndexFactorySource; StateManager = stateManager; LoggingOptions = loggingOptions; }
/// <summary> /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to /// the same compatibility standards as public APIs. It may be changed or removed without notice in /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// </summary> public RelationalCommandDiagnosticsLogger( ILoggerFactory loggerFactory, ILoggingOptions loggingOptions, DiagnosticSource diagnosticSource, LoggingDefinitions loggingDefinitions, IDbContextLogger contextLogger, IDbContextOptions contextOptions, IInterceptors?interceptors = null) : base(loggerFactory, loggingOptions, diagnosticSource, loggingDefinitions, contextLogger, interceptors) { var coreOptionsExtension = contextOptions.FindExtension <CoreOptionsExtension>() ?? new CoreOptionsExtension(); _loggingCacheTime = coreOptionsExtension.LoggingCacheTime; }
/// <summary> /// <para> /// Creates the service dependencies parameter object for a <see cref="CommandBatchPreparer" />. /// </para> /// <para> /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to /// the same compatibility standards as public APIs. It may be changed or removed without notice in /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// </para> /// <para> /// Do not call this constructor directly from either provider or application code as it may change /// as new dependencies are added. Instead, use this type in your constructor so that an instance /// will be created and injected automatically by the dependency injection container. To create /// an instance with some dependent services replaced, first resolve the object from the dependency /// injection container, then replace selected services using the 'With...' methods. Do not call /// the constructor at any point in this process. /// </para> /// </summary> public CommandBatchPreparerDependencies( [NotNull] IModificationCommandBatchFactory modificationCommandBatchFactory, [NotNull] IParameterNameGeneratorFactory parameterNameGeneratorFactory, [NotNull] IComparer <ModificationCommand> modificationCommandComparer, [NotNull] IKeyValueIndexFactorySource keyValueIndexFactorySource, [NotNull] ILoggingOptions loggingOptions, [NotNull] IDiagnosticsLogger <DbLoggerCategory.Update> updateLogger, [NotNull] IDbContextOptions options) { ModificationCommandBatchFactory = modificationCommandBatchFactory; ParameterNameGeneratorFactory = parameterNameGeneratorFactory; ModificationCommandComparer = modificationCommandComparer; KeyValueIndexFactorySource = keyValueIndexFactorySource; LoggingOptions = loggingOptions; UpdateLogger = updateLogger; Options = options; }
/// <summary> /// This API supports the Entity Framework Core infrastructure and is not intended to be used /// directly from your code. This API may change or be removed in future releases. /// </summary> public CommandBatchPreparer( [NotNull] IModificationCommandBatchFactory modificationCommandBatchFactory, [NotNull] IParameterNameGeneratorFactory parameterNameGeneratorFactory, [NotNull] IComparer <ModificationCommand> modificationCommandComparer, [NotNull] IKeyValueIndexFactorySource keyValueIndexFactorySource, [NotNull] ICurrentDbContext currentContext, [NotNull] ILoggingOptions loggingOptions) { _modificationCommandBatchFactory = modificationCommandBatchFactory; _parameterNameGeneratorFactory = parameterNameGeneratorFactory; _modificationCommandComparer = modificationCommandComparer; _keyValueIndexFactorySource = keyValueIndexFactorySource; _currentContext = currentContext; if (loggingOptions.IsSensitiveDataLoggingEnabled) { _sensitiveLoggingEnabled = true; } }
/// <summary> /// Creates an event definition instance. /// </summary> /// <param name="loggingOptions"> Logging options. </param> /// <param name="eventId"> The <see cref="Microsoft.Extensions.Logging.EventId" />. </param> /// <param name="level"> The <see cref="LogLevel" /> at which the event will be logged. </param> /// <param name="eventIdCode"> A string representing the code that should be passed to <see cref="DbContextOptionsBuilder.ConfigureWarnings"/>. </param> protected EventDefinitionBase( [NotNull] ILoggingOptions loggingOptions, EventId eventId, LogLevel level, [NotNull] string eventIdCode) { Check.NotNull(loggingOptions, nameof(loggingOptions)); Check.NotEmpty(eventIdCode, nameof(eventIdCode)); EventId = eventId; EventIdCode = eventIdCode; var warningsConfiguration = loggingOptions.WarningsConfiguration; if (warningsConfiguration != null) { var levelOverride = warningsConfiguration.GetLevel(eventId); if (levelOverride.HasValue) { level = levelOverride.Value; } var behavior = warningsConfiguration.GetBehavior(eventId); if (behavior.HasValue) { _warningBehavior = behavior.Value; } else { _warningBehavior = level == LogLevel.Warning && warningsConfiguration.DefaultBehavior == WarningBehavior.Throw ? WarningBehavior.Throw : WarningBehavior.Log; } } else { _warningBehavior = WarningBehavior.Log; } Level = level; }
public static void ConfigureLogger(ILoggingOptions loggingOptions, string appInsightsInstrumentationKey) { var loggerConfiguration = new LoggerConfiguration() .MinimumLevel.Debug() .MinimumLevel.Override("Microsoft", LogEventLevel.Information) .Enrich.FromLogContext() .WriteTo.Console(outputTemplate: loggingOptions.LogMessageTemplate) .WriteTo.Logger(l => l .WriteTo.File( Path.Combine(loggingOptions.LogsLocation, loggingOptions.LogFile), rollingInterval: RollingInterval.Day, outputTemplate: loggingOptions.LogMessageTemplate)); if (!string.IsNullOrEmpty(appInsightsInstrumentationKey)) { loggerConfiguration.WriteTo.ApplicationInsights(appInsightsInstrumentationKey, TelemetryConverter.Traces); } Log.Logger = loggerConfiguration.CreateLogger(); }
public FileContextStoreCache( [NotNull] ILoggingOptions loggingOptions, [CanBeNull] IFileContextSingletonOptions options) { _loggingOptions = loggingOptions; if (options?.DatabaseRoot != null) { _useNameMatching = true; LazyInitializer.EnsureInitialized( ref options.DatabaseRoot.Instance, () => new ConcurrentDictionary <IFileContextScopedOptions, IFileContextStore>()); _namedStores = (ConcurrentDictionary <IFileContextScopedOptions, IFileContextStore>)options.DatabaseRoot.Instance; } else { _namedStores = new ConcurrentDictionary <IFileContextScopedOptions, IFileContextStore>(); } }
public ChangeDetectorProxy( IDiagnosticsLogger <DbLoggerCategory.ChangeTracking> logger, ILoggingOptions loggingOptions) : base(logger, loggingOptions) { }
public MicaLogManager(ILoggingOptions loggingOptions) { this._loggingOptions = loggingOptions; }
public IndexingInMemoryTableFactory(ILoggingOptions loggingOptions) : base(loggingOptions) { }
/// <summary> /// Initialize <see cref="Log"/> /// </summary> /// <param name="outputPane">The Visual Studio output window pane</param> /// <param name="loggingOptions">The logging options</param> public void InitializeLog(IVsOutputWindowPane outputPane, ILoggingOptions loggingOptions) { _outputPane = outputPane; _loggingOptions = loggingOptions; }
/// <summary> /// This API supports the Entity Framework Core infrastructure and is not intended to be used /// directly from your code. This API may change or be removed in future releases. /// </summary> public InMemoryTableFactory([NotNull] ILoggingOptions loggingOptions) { Check.NotNull(loggingOptions, nameof(loggingOptions)); _sensitiveLoggingEnabled = loggingOptions.IsSensitiveDataLoggingEnabled; }
public EventDefinitionBaseStub(ILoggingOptions loggingOptions, EventId eventId, LogLevel level, string eventIdCode) : base(loggingOptions, eventId, level, eventIdCode) { }
public SerializableTableFactory(ILoggingOptions loggingOptions, LocalStorageOptions localStorageOptions, ISyncLocalStorageService localStorage) { _sensitiveLoggingEnabled = loggingOptions.IsSensitiveDataLoggingEnabled; _localStorageOptions = localStorageOptions; _localStorage = localStorage; }
protected void ActiveCorePreferencesRenders(LoggingConfigurationBuilder builder, ILoggingOptions settings) { if (settings is LoggingOptions options) { if (options.AutomaticalScanRendererEnabled) { PreferencesRenderersScanner.Scan(); } else { PreferencesRenderersScanner.Given(options.ManuallyRendererTypes); } } else { PreferencesRenderersScanner.Scan(); } }
protected void ActiveMessageTemplatePreheater(LoggingConfigurationBuilder builder, ILoggingOptions settings) { MessageTemplateCachePreheaterAction?.Invoke(_messageTemplateCachePreheater); }