There are 3 core classes, incorporated into a Windows Service application.
The SyslogListener class implements an RFC3164 compliant syslog listener which parses syslog messages sent to any interface the class is bound to.
The MemoryBuffer class class takes care of buffering incoming syslog messages in memory and submitting them to the SqlUpdater in batches, rather than keeping the database occupied with drip-fed messages.
The SqlUpdater class simply takes care of inserting SyslogMessage records into an SQL database.
The SyslogService Windows Service application class brings it all together:
- create the SqlUpdater class and establishes a connection to the SQL server
- create the MemoryBuffer class, and let it know about the SqlUpdater for which it will act as a buffer
- establish an event handler for the SyslogListener message-received event, to save messages into the memory-buffer
code is available for download from here .