I am trying to write to a custom event source in .netcore/c# but have not found a way to specify the target source of .net core's logger object. In this case, I want to write to "My Event Log" as opposed to the Application log. The code below writes successfully to the Application log, but I want to point it at the "My Event Log" event source.
if (!EventLog.SourceExists("My Event Log"))
{
EventLog.CreateEventSource("My Event Log", "My Program");
}
ILoggerFactory loggerFactory = new LoggerFactory()
.AddConsole()
.AddDebug()
.AddEventLog();
ILogger logger = loggerFactory.CreateLogger<Program>();
logger.LogInformation("DAILY LOAD starting...");