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
In doing so you will be presented with a page that looks similar to
From here you can click on the Edit pencil on each row and enable or disable the Logging setting
You can also turn options on such as email notifications and the Keep Most Recent entries option
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.