How To Keep Your Umbraco Database Healthy... Clear Umbraco Database Logs

Auditing can be an invaluable tool for any website, being able to know who save what, when people logged in etc.. in Umbraco auditing is done in the database. When you launch your website everything is all brilliant; the skies are blue and the sun's out. Over a period of time you might notice your website to take a little bit long and your SQL back-up keep creeping up in size. While auditing can be really useful... the bad news about auditing is that over a period of time the log files can fill up your database. Luckily, clearing out your log files is relatively painless.. The first way we can go about this is the old school SQL way. Most of you are probably thinking just run a delete command against the 'umbracoLog' table. Clearing the table is the right approach.. but the delete command isn't the best approach. As you are reading this guide, I'm assuming using your log table has become a bit out of hand. A TRUNCATE command is a lot faster than a DELETE command, also all DELETE commands are logged in the SQL transaction log, as you're clearing the log files and the data is never used by Umbraco itself is pretty pointless and takes up needed space, so I would use: [sqml] Truncate Table umbracoLog [/sqml] If that doesn't work then you could attempt to squish your SQL logs. To do that, open SQL Manager, right click on the database, select Tasks -> Shrink -> Files. In 'Shrink File' change the file type to Log and click on 'OK'. Although the advice in this article is quite simple, it can really help speed up your site and boost performance.

Jon D Jones

Software Architect, Programmer and Technologist Jon Jones is founder and CEO of London-based tech firm Digital Prompt. He has been working in the field for nearly a decade, specializing in new technologies and technical solution research in the web business. A passionate blogger by heart , speaker & consultant from England.. always on the hunt for the next challenge

Back to top
var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-35662136-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + ''; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();