hplog A High-Performance Logger The hplog contains a high-performance logger interface. Features: + Separate logger process so no log lines get lost on application crash + Buffered read and writes to increase performance + Automatically rotating logs with configurable number of backlogs + Configurable log size + up-to-date logfile (in spite of buffering) Other interesting things: Uses 6 systems calls in underload situations per log line 1 send() in the application 1 nonblocking recv() in the log process 1 select() in the log process 1 recv() in the log process 1 time() in the log process 1 write() (called from fflush()) in the log process Uses LESS systems calls in overload situations per log line 1 send in the application the kernel buffers several log lines into one chunk recevied by recv() for each chunk: 1 recv() (select() and second recv() is optimized away) 1 time() <1 write() (is buffered into 32K chunks) Compilation / use Compile hplogd.cc as a separate application Put it somewhere in your path Include hplog.cc in your normal application. If it is multithreaded make sure that you compile hplog.cc with -D_REENTRANT Fan letters / suggestions: isj@dont_forget_to_remove_this.image.dk.invalid