DNN Tip: Pruning the EventLog with EventLogConfig

DNN Tip: Pruning the EventLog with EventLogConfig

In an earlier blog post I talked about the EventLog table and the Exceptions table, specifically in terms of how to “clear” the tables out. This post will talk specifically about how to keep the EventLog table cleaned up to begin with.

In DNN you have the ability to configure if you would like specific EventLogTypes to be tracked or not. By default in DNN there are over 100 different events that can be tracked in the EventLog table. Many of these are turned off by default, you can configure them to be “on” by going to the Admin Logs page in the Persona Bar, and choose the Log Settings tab

image

In doing so you will be presented with a page that looks similar to

image

From here you can click on the Edit pencil on each row and enable or disable the Logging setting

image

You can also turn options on such as email notifications and the Keep Most Recent entries option

image

Some of the default options in DNN will have the Keep Most Recent option configured to a low number, like “10 Entries” but some will have them set to All. This can cause the EventLog table to fill up with many many many events, depending on how much traffic your website gets. You can go through and set these all manually through the ADMIN UI, or you can do it in bulk in the database with this simple SQL statement:

update Eventlogconfig
set keepmostrecent = 10

If you’re using the SQL Console page you can use this statement

update {databaseOwner}{objectQualifier}Eventlogconfig
set keepmostrecent = 10


Warning: You might actually want to keep ALL logs for your site, depends on your industry and needs, but I prefer to keep mine pruned to try to keep the database smaller, more manageable and better performing.

Read More at weblogs.asp.net:80

Recent Comments

There are currently no comments. Be the first to make a comment.

Add Comment

Please add your comment by filling out the field(s) below. Your comment may need to be approved before it becomes visible.
Enter your first name for display with the comment
Enter your last name for display with the comment.
Enter your comment here.
If you can't type DNNRocks in, you can't post, plain and simple.
Submit Comment Cancel

Chris Hammond

Chris Hammond is a father, husband, leader, software developer, photographer and car guy. Chris focuses on the latest in technology including artificial intelligence (AI) and has spent decades becoming an expert in ASP.NET and DotNetNuke (DNN) development. You will find a variety of posts relating to those topics here on the website. For more information check out the about Chris Hammond page.

Find me on Twitter, GitHub and LinkedIn.