37 instantiations of LoggerFactory
Aspire.Hosting.Testing.Tests (1)
ResourceLoggerForwarderServiceTests.cs (1)
58var fakeLoggerFactory = new LoggerFactory([fakeLoggerProvider, new XunitLoggerProvider(output)]);
IIS.Microbenchmarks (1)
PlaintextBenchmark.cs (1)
26_server = TestServer.Create(builder => builder.UseMiddleware<PlaintextMiddleware>(), new LoggerFactory(), new IISServerOptions()).GetAwaiter().GetResult();
InMemory.FunctionalTests (1)
HttpsConnectionMiddlewareTests.cs (1)
1479var loggerFactory = testLogger is null ? (ILoggerFactory)NullLoggerFactory.Instance : new LoggerFactory(new[] { new KestrelTestLoggerProvider(testLogger) });
Microsoft.AspNetCore.Antiforgery.Test (1)
DefaultAntiforgeryTest.cs (1)
1404builder.AddSingleton<ILoggerFactory>(new LoggerFactory());
Microsoft.AspNetCore.Http.Connections.Tests (1)
HttpConnectionDispatcherTests.cs (1)
3775loggerFactory ?? new LoggerFactory(),
Microsoft.AspNetCore.Identity.Test (6)
SecurityStampValidatorTest.cs (6)
122services.AddSingleton<ISecurityStampValidator>(new SecurityStampValidator<PocoUser>(options.Object, signInManager.Object, new LoggerFactory())); 176services.AddSingleton<ISecurityStampValidator>(new SecurityStampValidator<PocoUser>(options.Object, signInManager, new LoggerFactory())); 217services.AddSingleton<ISecurityStampValidator>(new SecurityStampValidator<PocoUser>(options.Object, signInManager.Object, new LoggerFactory())); 255services.AddSingleton<ISecurityStampValidator>(new SecurityStampValidator<PocoUser>(options.Object, signInManager.Object, new LoggerFactory())); 293services.AddSingleton<ISecurityStampValidator>(new SecurityStampValidator<PocoUser>(options.Object, signInManager.Object, new LoggerFactory())); 342services.AddSingleton<ITwoFactorSecurityStampValidator>(new TwoFactorSecurityStampValidator<PocoUser>(options.Object, signInManager.Object, new LoggerFactory()));
Microsoft.AspNetCore.InternalTesting.Tests (1)
LoggedTestXunitTests.cs (1)
108var loggerFactory = new LoggerFactory();
Microsoft.AspNetCore.Mvc.IntegrationTests (1)
TestMvcOptions.cs (1)
37var loggerFactory = new LoggerFactory();
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (6)
Listener\ServerTests.cs (1)
135using var listener = new HttpSysListener(options, new LoggerFactory());
Listener\Utilities.cs (3)
50var listener = new HttpSysListener(options, new LoggerFactory()); 79var listener = new HttpSysListener(new HttpSysOptions(), new LoggerFactory()); 89var listener = new HttpSysListener(options, new LoggerFactory());
Utilities.cs (2)
115=> new MessagePump(Options.Create(new HttpSysOptions()), loggerFactory ?? new LoggerFactory(), new AuthenticationSchemeProvider(Options.Create(new AuthenticationOptions()))); 121return new MessagePump(Options.Create(options), loggerFactory ?? new LoggerFactory(), new AuthenticationSchemeProvider(Options.Create(new AuthenticationOptions())));
Microsoft.AspNetCore.Server.HttpSys.NonHelixTests (2)
Utilities.cs (2)
34=> new MessagePump(Options.Create(new HttpSysOptions()), loggerFactory ?? new LoggerFactory(), new AuthenticationSchemeProvider(Options.Create(new AuthenticationOptions()))); 40return new MessagePump(Options.Create(options), loggerFactory ?? new LoggerFactory(), new AuthenticationSchemeProvider(Options.Create(new AuthenticationOptions())));
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (5)
ConnectionDispatcherTests.cs (1)
27var loggerFactory = new LoggerFactory(new[] { new KestrelTestLoggerProvider(testLogger) });
KestrelServerTests.cs (4)
285new LoggerFactory(new[] { new KestrelTestLoggerProvider() }))); 311loggerFactory ?? new LoggerFactory(new[] { new KestrelTestLoggerProvider() }), 974return new KestrelServer(Options.Create(options), new MockTransportFactory(), new LoggerFactory(new[] { new KestrelTestLoggerProvider(testLogger) })); 979return new KestrelServer(Options.Create(options), new MockTransportFactory(), new LoggerFactory(new[] { new KestrelTestLoggerProvider(throwOnCriticalErrors) }));
Microsoft.AspNetCore.SignalR.Tests (3)
DefaultTransportFactoryTests.cs (3)
24Assert.NotNull(new DefaultTransportFactory(transportType, new LoggerFactory(), new HttpClient(), httpConnectionOptions: null, accessTokenProvider: null)); 36() => new DefaultTransportFactory(transportType, new LoggerFactory(), httpClient: null, httpConnectionOptions: null, accessTokenProvider: null)); 44new DefaultTransportFactory(HttpTransportType.WebSockets, new LoggerFactory(), httpClient: null, httpConnectionOptions: null, accessTokenProvider: null);
Microsoft.AspNetCore.SignalR.Tests.Utils (1)
src\Shared\SignalR\VerifyNoErrorScope.cs (1)
28LoggerFactory = loggerFactory ?? new LoggerFactory();
Microsoft.CodeAnalysis.LanguageServer.UnitTests (2)
Utilities\TestOutputLogger.cs (1)
18Factory = new LoggerFactory([new TestLoggerProvider(this)]);
WorkspaceProjectFactoryServiceTests.cs (1)
20var loggerFactory = new LoggerFactory();
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\DiagnosticReporterLoggerProvider.cs (1)
31return new LoggerFactory(
Microsoft.Extensions.Diagnostics.Testing (1)
Logging\FakeLoggerT.cs (1)
47using var factory = new LoggerFactory();
Microsoft.Extensions.Diagnostics.Testing.Tests (1)
Logging\FakeLoggerProviderTests.cs (1)
40using var factory = new LoggerFactory();
Microsoft.Extensions.Telemetry.Tests (1)
Logging\ExtendedLoggerTests.cs (1)
619using var loggerFactory = new LoggerFactory();
Sockets.BindTests (1)
SocketTransportFactoryTests.cs (1)
20var socketTransportFactory = new SocketTransportFactory(Options.Create(new SocketTransportOptions()), new LoggerFactory());
45 references to LoggerFactory
Aspire.Dashboard.Components.Tests (1)
Shared\IntegrationTestHelpers.cs (1)
14return LoggerFactory.Create(builder =>
Aspire.Dashboard.Tests (7)
Integration\IntegrationTestHelpers.cs (2)
28return LoggerFactory.Create(builder => 143var loggerFactory = LoggerFactory.Create(builder =>
Model\ApplicationsSelectHelpersTests.cs (2)
95var factory = LoggerFactory.Create(b => b.AddProvider(new TestLoggerProvider(testSink))); 119var factory = LoggerFactory.Create(b => b.AddProvider(new TestLoggerProvider(testSink)));
TelemetryRepositoryTests\OtlpHelpersTests.cs (2)
415var factory = LoggerFactory.Create(b => 460var factory = LoggerFactory.Create(b =>
TelemetryRepositoryTests\TraceTests.cs (1)
100var factory = LoggerFactory.Create(b => b.AddProvider(new TestLoggerProvider(testSink)));
Aspire.Hosting.Tests (2)
Dashboard\DashboardLifecycleHookTests.cs (1)
33var factory = LoggerFactory.Create(b =>
Dashboard\DashboardServiceTests.cs (1)
76var loggerFactory = LoggerFactory.Create(builder =>
BuildValidator (1)
Program.cs (1)
114var loggerFactory = LoggerFactory.Create(builder =>
Microsoft.AspNetCore.Hosting (2)
WebHostBuilderExtensions.cs (2)
236/// Adds a delegate for configuring the provided <see cref="LoggerFactory"/>. This may be called multiple times. 239/// <param name="configureLogging">The delegate that configures the <see cref="LoggerFactory"/>.</param>
Microsoft.AspNetCore.InternalTesting.Tests (1)
LoggedTestXunitTests.cs (1)
108var loggerFactory = new LoggerFactory();
Microsoft.AspNetCore.Mvc.Core.Test (1)
LocalRedirectResultTest.cs (1)
141serviceCollection.AddTransient<ILoggerFactory, LoggerFactory>();
Microsoft.AspNetCore.Mvc.IntegrationTests (1)
TestMvcOptions.cs (1)
37var loggerFactory = new LoggerFactory();
Microsoft.AspNetCore.Mvc.Test (1)
MvcOptionsSetupTest.cs (1)
293.AddTransient<ILoggerFactory, LoggerFactory>()
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
ConnectionDispatcherTests.cs (1)
27var loggerFactory = new LoggerFactory(new[] { new KestrelTestLoggerProvider(testLogger) });
Microsoft.CodeAnalysis.LanguageServer (2)
Program.cs (2)
45using var loggerFactory = LoggerFactory.Create(builder => 52LoggerFactory.Create(builder =>
Microsoft.CodeAnalysis.LanguageServer.UnitTests (1)
WorkspaceProjectFactoryServiceTests.cs (1)
20var loggerFactory = new LoggerFactory();
Microsoft.CodeAnalysis.Rebuild.UnitTests (4)
CompilationOptionsReaderTests.cs (1)
36var factory = LoggerFactory.Create(configure => { });
CSharpRebuildTests.cs (1)
30var factory = LoggerFactory.Create(configure => { });
RoundTripUtil.cs (2)
44var factory = LoggerFactory.Create(configure => { }); 77var factory = LoggerFactory.Create(configure => { });
Microsoft.DotNet.SwaggerGenerator.CmdLine (1)
Program.cs (1)
83ILogger logger = LoggerFactory.Create(builder => builder.AddSimpleConsole()).CreateLogger("dotnet-swaggergen");
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (3)
TelemetryHealthChecksPublisherExtensionsTests.cs (3)
21.AddSingleton<ILoggerFactory, LoggerFactory>() 38.AddSingleton<ILoggerFactory, LoggerFactory>() 58.AddSingleton<ILoggerFactory, LoggerFactory>()
Microsoft.Extensions.Diagnostics.Testing (1)
Logging\FakeLoggerT.cs (1)
47using var factory = new LoggerFactory();
Microsoft.Extensions.Diagnostics.Testing.Tests (1)
Logging\FakeLoggerProviderTests.cs (1)
40using var factory = new LoggerFactory();
Microsoft.Extensions.Logging (10)
LoggerFactory.cs (9)
32/// Creates a new <see cref="LoggerFactory"/> instance. 39/// Creates a new <see cref="LoggerFactory"/> instance. 47/// Creates a new <see cref="LoggerFactory"/> instance. 56/// Creates a new <see cref="LoggerFactory"/> instance. 65/// Creates a new <see cref="LoggerFactory"/> instance. 75/// Creates a new <see cref="LoggerFactory"/> instance. 143throw new ObjectDisposedException(nameof(LoggerFactory)); 172throw new ObjectDisposedException(nameof(LoggerFactory)); 327private sealed class LoggerFactoryDebugView(LoggerFactory loggerFactory)
LoggingServiceCollectionExtensions.cs (1)
38services.TryAdd(ServiceDescriptor.Singleton<ILoggerFactory, LoggerFactory>());
Microsoft.Extensions.Telemetry (2)
Logging\ExtendedLoggerFactory.cs (2)
131throw new ObjectDisposedException(nameof(LoggerFactory)); 155throw new ObjectDisposedException(nameof(LoggerFactory));
Microsoft.Extensions.Telemetry.Tests (1)
Logging\ExtendedLoggerTests.cs (1)
619using var loggerFactory = new LoggerFactory();
Microsoft.ML.GenAI.Samples (1)
Llama\SFT_Llama_3_2_1B.cs (1)
25using var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole());