<< 15 August 2006 | Home | 17 August 2006 >>

AutoPurge for OpenLog

We are using the OpenLog logging framework written by Julian extensively in our applications but in logging intensive applications or when running with our custom DEBUG-level enabled you can generate a lot of logging documents. Cleaning these up should preferably be done automatically on a scheduled basis so I wrote a small agent to purge log documents older than 6 months and thought I would share:

Sub Initialize
   Dim session As New NotesSession
   Dim db As NotesDatabase
   Dim dc As NotesDocumentCollection
   Dim dt As NotesDateTime
	
   Set dt = New NotesDateTime(session.International.Today)
   Call dt.AdjustMonth(-6)
   Set db = session.CurrentDatabase
   Set dc = db.Search(|Form="LogEvent" & LogEventTime<@TextToTime("| + dt.DateOnly + |")|, Nothing, 0)
   
   Call dc.RemoveAll(True)
End Sub
Really simple and nothing much to it...

Google Analytics

The by-invitation-only entry to Google Analytics has been removed so anyone who wants an account may have one. For those who do not know what Google Analytics is, it's a free, totally cool web statictics package from Google. Installing it takes 2 minutes and is done by copy/pasting some JavaScript into your page layout. I highly recommend it.

To read more stop by the Google Analytics blog.