Are there any example code on how to log events into the eventviewer?
We use Dynamicweb.Logging.LogManager but that only creates files in the System/Logs folder, not in the event viewer.
Are there any example code on how to log events into the eventviewer?
We use Dynamicweb.Logging.LogManager but that only creates files in the System/Logs folder, not in the event viewer.
Like this:
LogManager.System.GetLogger(LogCategory.Application, "SubCategory").Info(message)
or like this for exceptions:
LogManager.System.GetLogger(LogCategory.Health, "Unhandled").Error(exception.Message, exception)
Perfect, thanks!
You must be logged in to post in the forum