Hi,
I am trying to set EventLogSettings but the log continues to write to the default Windows Logs -> Application
Using .net 3.1 to build Worker Service
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .UseWindowsService() .ConfigureLogging((context, logging) => { logging.AddEventLog(new EventLogSettings() { SourceName = "TestSource", LogName = "TestLog" }); }) .ConfigureServices((hostContext, services) => { services.AddHostedService<Worker>(); });
I have also tried to add a log with powershell New-EventLog -LogName TestLog -Source TestSource
AG