Skip to content

Custom event log in Dotnetnuke

January 3, 2011

Hello,

Easy way to log events in the event log is as follows

Method 1:

DotNetNuke.Services.Log.EventLog.EventLogController objEventLog = new DotNetNuke.Services.Log.EventLog.EventLogController();

objEventLog.AddLog(“Error Message”, “Some error has occurred while processing”, PortalSettings,UserInfo.UserID, DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ALERT);

Method 2:

DotNetNuke.Services.Log.EventLog.LogInfo logInfo = new DotNetNuke.Services.Log.EventLog.LogInfo();

logInfo.LogUserID = UserId;

logInfo.LogPortalID = PortalSettings.PortalId;

logInfo.LogTypeKey = EventLogController.EventLogType.ADMIN_ALERT.ToString();

logInfo.AddProperty(“Test Property 1″, StringValue1);

logInfo.AddProperty(“Test Property 2″, StringValue2);

eventLog.AddLog(logInfo);

Advertisement
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.