I have not been able to use the loggerFactory.AddEventLog() in .Net Core 2.0. As the Microsoft.Extensions.Logger.EventLog only lives in .net 4.5.1 although the Nuget package is available for 2.0.0 here , so looks like it needs to be ported to Core.
but maybe this will work for you.
Add your CustomEventIds
public static class CustomEventIds
{
public const int Debug = 100;
public const int Information = 101;
public const int Warning = 102;
public const int Error = 103;
public const int Critical = 104;
}
and:
_logger.LogInformation(CustomEventIds.Debug, "Starting to do something with input: {0}", "test");