Write to EventLog in .Net Core

I need a way to write to the windows event viewer in my application using dnx. But the class is EventLognot available in the namespace System.Diagnostics, so I'm stuck. Is there any other way to record in EventViewer?

+8
source share
3 answers

Add from NuGet Microsoft.Extensions.Logging.EventLog Version 2.1.1

CM> Install-Package Microsoft.Extensions.Logging.EventLog -Version 2.1.1

Include namespace Microsoft.Extensions.Logging.EventLogin fileProgram.cs

This solved my problem.

+5
source

Good news! EventLog is already ported to corefx and will be available in .NET Core 2.1 .

System.Diagnostics.EventLog MyGet feed.

+1

Source: https://habr.com/ru/post/1652382/


All Articles