Developer forum

Forum » Development » Log to event viewer

Log to event viewer

Martin Grønbekk Moen
Martin Grønbekk Moen
Reply

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.


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

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)
Votes for this answer: 3
 
Martin Grønbekk Moen
Martin Grønbekk Moen
Reply

Perfect, thanks!

 

You must be logged in to post in the forum