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.

image

At some point, if you manage a DNN based website long enough, you are going to run into a problem where your database seems to have grown WAY bigger than it should be. I’m not talking a couple hundred megs, I’m talking gigabytes, lots of gigabytes. This post will hopefully help you get that under control.

Tonight, I had a DNN instance that I was looking to migrate to Azure, in preparation for this I remoted into the web and database servers to see what the files and database looked like. The database MDF file was almost 1.5gb in size, for a DNN instance that has 5 portals, and very very little activity, this was concerning. I knew where to start looking though, there are two tables to start with, Exceptions and EventLog. The EventLog is tied to the “Admin Logs” in DNN 9, in earlier versions of DNN the menu item was Event Logs or even Event Viewer.

Running the following simple SQL query will get you an idea of how many rows are in those tables.

select count(1) from Exceptions with (nolock)

select count(1) from EventLog with (nolock)

If you’re running this in the SQL Console on your DNN site you might run it with

select count(1) from {databaseOwner}{objectQualifier}Exceptions with (nolock)

select count(1) from {databaseOwner}{objectQualifier}EventLog with (nolock)

This will give you a “count” of the number of rows in each of those tables. In my case, the EventLog table only had 394 records, but the Exceptions table had 300k+. That’s a pretty common cause of database size creep in DNN. Ultimately what my issue was, I had one site that still used “SolPartMenu” in the Containers for the skin, and with DNN9, those no longer work, and every request that tried to load that site (mostly search engines hitting it) caused multiple records to be thrown into the EventLog and Exceptions table.

Message:Object reference not set to an instance of an object.
StackTrace:
at DotNetNuke.UI.Skins.Pane.LoadModuleContainer(ModuleInfo module) at DotNetNuke.UI.Skins.Pane.InjectModule(ModuleInfo module)

Now, the question is how did I know what the cause of that cryptic error message was? Well, I had just spent some time with a customer of mine this weekend upgrading their website, and they ran into the same problem, so it was fresh in my head, and I was easily able to correct this.

But let’s get back to the topic of the post, the Exceptions and EventLog tables. DNN has a way to “purge” the eventlog built into the system, and most “types” of events only get stored 10 times, so when the 11th event comes in, the first one gets cleared from the system. But, the exception Events also get logged to the Exceptions table, and there doesn’t appear to be anything in DNN that cleans that table up automatically. Because I upgraded the site to DNN 9 well over a month ago, I had hundreds of thousands of exceptions in the table. So I needed to get this cleaned up, that’s easy with the following SQL statement.

truncate table Exceptions

or the DNN SQL Console version

truncate table {databaseOwner}{objectQualifier}Exceptions

That forces the table to be purged, and then using SQL Server Management Studio I was able to run a SHRINK command on the database, bringing the files back down to an expected 30 mb.

Now you might think, well can’t I do the same on the EventLog table? Unfortunately the simple answer to that is no. The longer answer is YES, but you’ll want to look at Sebastian’s SQL script for doing so: http://dnnscript.codeplex.com/releases/view/612643

I ran into a problem this evening with Visual Studio 2017 hanging when opening my Solution that I'm working on for my DNNTemplates VSIX project. It would open up solution explorer, it would also open up the TABS in visual studio, but it wouldn’t complete the process and would hang on “Opening the files”.

Basically every time I opened the solution, no matter what I tried, rebooting, deleting the .SUO file, deleting the .USER files, nothing would seem to work. I would let Visual Studio site for hours, and it would never complete the opening process.

Finally I went in and deleted the contents of the .VS folder, after deleting this contents the solution can successfully be opened.

So if you run into problems with “Opening the files”, try deleting the contents of the .vs folder in your solution directory, hopefully that will help you.

If anyone from the Visual Studio team wants to reach out to me on this, I have perfview files and files collected from collect.exe as I was trying to troubleshoot the issue.

With the improvements in Visual Studio 2017, the installation process can be much more compact and streamlined, allowing you to choose which “workloads” you want to install. But what happens when you need a workload that you don’t have installed? Well with a little digging I was able to determine the process to do so, check out the steps listed below.

  1. Shut down any running Visual Studio 2017 instances
  2. Click on your Start Menu and Type “Visual Studio Installer”
    image
  3. Once you have the installer open, if you see an “Update” option, go ahead and update Visual Studio 2017 before proceeding
    image

  4. After you have VS up to date, you should see a Modify option available
    image
  5. Once you click Modify you’ll be presented with the Workloads selection option in which you can choose your necessary workloads.
    image

Any time you need to add ore remove workloads, you can always get back to this screen.

With the Release Candidate for Visual Studio 2017 Community I did run into one problem where the “install” file ended up being lost. If that’s the case just download the vs_community.exe again from Microsoft and run that, it’ll restore what you need and get you back to the appropriate process.

Mary Jo Foley is reporting that Visual Studio 2017 will release on March 7th, 2017.

I guess I better get to updating my DNN Extension Templates for Visual Studio before that release hits!

Head on over to http://launch.visualstudio.com for details on some virtual launch events.

What are you looking forward to most with Visual Studio 2017? 

I'm hoping for faster installation times than it takes to install your operating system!

RSS URL

Chris Hammond is

Chris Hammond is a father, husband, leader, developer and car guy. Chris has long specialized in ASP.NET and DotNetNuke development, so you will find a variety of topics here on the website. For more information check out the about me page.

If you are looking for DotNetNuke consulting please visit my business website at http://www.christoc.com/

Latest Photos

Follow Me Facebook Me Plus Me

Disclaimer

Any blog posts here are solely the opinion and views of Chris Hammond only. Comments on blog posts are the opinion of the commenter, and not Chris Hammond.

DotNetNuke Hosting

Hosting for this website is provided by AppliedI.Net. Be sure to visit them for all your DotNetNuke Hosting needs. 

Powered By

This website is managed by Christoc.com Software Solutions

Find Me