Logger Socket
-------------
Version : 1.1
Author : Dirk Claessens <dirkcl@pandora.be>
Purpose
-------
Many applications somehow maintain log files, especially applications that
run continuously for 365 days/year. If you have many of those applications,
you will need to inspect many logfiles, all physically located on many systems
in the network. Wouldn't it be nice to have =one= central log for all of those
applications? Read on, as that's what socklog is intended for.
Each application that wishes to use SockLog, simply opens a socket connection
to it, and can from then on send it's log messages to SockLog.
SockLog will gather this messages into a memory buffer, and periodically dump
the buffer into a file for later inspection.
In this version, the log files are organised into "hour" files, that is,
each log file contains the messages logged in a particular hour of the day.
Depending on your needs, you can easily change this to "day" files, or even
- if your log throughput is gigantic - in "minute" files.
Message Format
--------------
To assure proper operation, SockLog expects incoming messages to be prepended
with a special message header.
==============================================================
**Note that SockLog will reject messages in any other format**
==============================================================
Simply do:
uses LogCommon;
MyLogMessage := LogCommon.FormatLogMessage( 'MY_APP', 'my log test' );
to format a message in the expected format.
Even better, do:
LogCommon.SendLogMessage( YourSocket, 'MY_APP', 'my log test');
which will take care of the formatting and the sending;
Testing
-------
A testapp is included ( TestLog.dpr ).
Simply fill in the host name where LogSock.exe runs, and do some testing.
(
note that you can test this from the same machine, and that you can run
TestLog.exe multiple times on one machine
)
Viewing the logs
----------------
I have included a simple viewing tool, that you can use to review the
log files. You can also search for text.
I hope you will find SockLog useful!
Regards - Dirk
评论0