Search

View Article

14

A common technique I use to work out additional debug information for DotNetNuke modules is to log information to the event log (found at admin -> log viewer).

The advantage of this technique is that you are taking advantage of a very extensible logger and providing it in a utility familiar to the portal administrator. You can log minor events such as (person X has uploaded a picture) or to capture errors (an email failed to send, and here were the arguments in the email).

Using the event log in code is quite simple, the code is as follows:-

First, create an instance of the EventLogViewer...

Dim objEventLog As New DotNetNuke.Services.Log.EventLog.EventLogController

Next, log the event you wish to trap...

objEventLog.AddLog("Sample Message", "Something Interesting Happened!", PortalSettings, -1, DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ALERT)

Now, when this code is run, the event log entry should appear in admin -> log viewer! You can customise these type of events, whether they be admin, host, item updated, etc.

It's features like this that really allow you to put together applications quickly by using features already available in the underlying framework.

Posted in: DotNetNuke

Post Rating

Comments

#
Friday, July 14, 2006 7:35 AM
Log Viewer Article
#
Tuesday, August 29, 2006 8:44 PM
External Trackback Test
arjun
# arjun
Monday, April 9, 2007 4:25 AM
i am searching this type of output.Will u send me the clear information.
arjun
# arjun
Monday, April 9, 2007 4:26 AM
i am searching this type of output.Will u send me the clear information.
#
Tuesday, May 1, 2007 8:35 AM
Writing an DNN Event Log Entry in code
#
Tuesday, May 1, 2007 8:35 AM
Writing an DNN Event Log Entry in code
#
Tuesday, May 1, 2007 8:35 AM
Writing an DNN Event Log Entry in code
Steve J.
# Steve J.
Tuesday, September 9, 2008 5:00 AM
testing the comment template on the website
joe net
# joe net
Wednesday, December 9, 2009 2:39 PM
test test

Post Comment

Only registered users may post comments.