For debugging purposes, how can I print to the event log/viewer in DotNetNuke, using VB.NET or C#?
using DotNetNuke.Common.Utilities;
using DotNetNuke.Services.Log.EventLog;
public static void DnnEventLogMsg(string msg)
{
EventLogController eventLog = new EventLogController();
DotNetNuke.Services.Log.EventLog.LogInfo logInfo = new LogInfo();
PortalSettings ps = PortalController.Instance.GetCurrentPortalSettings();
UserInfo userInfo = UserController.Instance.GetCurrentUserInfo();
logInfo.LogUserID = userInfo.UserID;
logInfo.LogPortalID = ps.PortalId;
logInfo.LogTypeKey = EventLogController.EventLogType.ADMIN_ALERT.ToString();
logInfo.AddProperty("Atena3 Message", msg);
eventLog.AddLog(logInfo);
}