From a3c53fe93626a09757cd83e3d253ab4dbf2f5488 Mon Sep 17 00:00:00 2001 From: yaworsky Date: Tue, 18 Oct 2005 03:46:52 +0000 Subject: Added to CVS. --- doc/src/internals.xml | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 doc/src/internals.xml (limited to 'doc/src/internals.xml') diff --git a/doc/src/internals.xml b/doc/src/internals.xml new file mode 100644 index 0000000..0ac12ec --- /dev/null +++ b/doc/src/internals.xml @@ -0,0 +1,83 @@ + +There are three basic parts of daemon: listener, message processor and +message writer. +All these parts run in separate threads: +the listener receives messages as fast as possible and passes them to the +message processor, +the message processor performs time-consuming tasks and +message writer performs asynchronous output to files. + + +Datagrams are received by the listener. +The listener emits raw messages (struct raw_message) which contain content +of datagram, sender address and reference to a source described +in configuration file. + + +Raw messages are passed to the processing thread via queue. +Message processing involves the following tasks: + + + +parse datagram: +pick out PRI, TIMESTAMP, HOSTNAME, TAG an CONTENT according to +RFC 3164; + + + + +convert CONTENT's encoding if specified; + + + + +determine sender host name if option is set or just +convert IP address to string; +the result is saved in hostname cache to speed up subsequent resolutions; + + + + +multiplex message to logpaths and apply filters in logpaths; +in other words, messages are multiplexed to logpaths through filters; +messages in logpaths are represented with references to message structure +and message structure contains reference count; + + + +Because destination file name may be a pattern, further multiplexing is +performed. Messages with similar HOSTNAME, TAG and CONTENT are coalesced. + + +Log rotation is initiated at process startup or at writing thread startup. + + +Old log files are deleted by the purger which is launched at process startup +or by the writing thread after file is closed. + ++--------+ raw message +-----+ +------+ message +-----------------+ +|listener|------------>|queue|--->|parser|-------->|charset converter|---> ++--------+ +-----+ +------+ +-----------------+ + + +------+ +-----------+ +-----------+ +--->|filter|--->|multiplexer|-+->|destination|+ + +------+ +-----------+ +->+-----------+|+ + ^ +-> +-----------+| + | +-----------+ + +-------+ + |logpath|+ + +-------+|+ + +-------+| + +-------+ + + + +-----------+ +-----+ +--------------+ +destination: >--|multiplexer|-+->|queue|+ ---> |writing thread|+ + +-----------+ +->+-----+|+ ---> +--------------+|+ + ^ +-> +-----+| ---> +--------------+| + | +-----+ +--------------+ + +----------------+ + |filename pattern| + +----------------+ + + -- cgit v1.2.3