CS Nuglet: Extending the life of Eventlog records

Community Server contains an EventLogJob task that removes Eventlog records older than two days.  I use the Eventlog a lot to track custom tasks and various other processes, so I want to retain more than two days’ worth of records in my event log.

The CommunityServer.config file <tasks /> area contains the EventLog task configuration.  We could disable the job, but since cleaning out the eventlog periodically is a good idea, we’ll add a “days” attribute.  If you look at the EventLogJob task source below, a “days” attribute is supported but not present in the cs.config by default. 

 

 

So we add it as shown below in bold. 

<task name = “EventLog” type = “CommunityServer.Components.EventLogJob,
    CommunityServer.Components” enabled = “true” enableShutDown = “false” days = “10” />

Article written by

A long time developer, I was an early adopter of Linux in the mid-90's for a few years until I entered corporate environments and worked with Microsoft technologies like ASP, then .NET. In 2008 I released Sueetie, an Online Community Platform built in .NET. In late 2012 I returned to my Linux roots and locked in on Java development. Much of my work is available on GitHub.