Rudolf's Radius Klassenbibliothek
Left Up Klassenbibliothek

Log-File Classes

Overview

The Logfile Classes are specified in daemon/radlog.h
There are two possibilities for the logfile format specified:
FieldLogfile
we log only interesting fields in a flat logfile.

This type of logfile is good for accounting purpose and Unix-Tools can easily used to make statistics.

The class logspez contains the list of attributes which should be logged.

PaketLogfile
We want to see all the attributes in the paket. The other radiusd use such a logfile.
The common things are in the class logfile:
init
sets the logfilename
begin
opens the logfile
end
close the logfile
reinit
close the logfile and open it again (for the SIGHUP_Signal)
log
locks the message
logstr
writes string in the logfile (like printf)
lock and unlock does the coordination.

Some remarks tho the libg++ and the implementation

Because I have implemented the debugging ith ste iostreamslibrary, I want to reuse it for logging purpose.
But a few important questions remains:
How should the coordination between the Workers be done ?
I think, the best is to use the Systemcall flock directly. I must know, when the Buffer is flushed and the filehandle. So I use the ostrstream-class for formatting, and the write(2) Systemcall for writing, so I know waht we have.

An other posibility to use the ofstream::ofstream(int fd), which use a already openend filedescriptor. What is when the Destuktor ~ofstream is called ?

Is the libg++ 2.7 for singletasking only ? Please help me.

Reusing of the ostrstream
I would like to open the ostrstream once with a static buffer and reusing it for every paket.

Instead we have a new instance each time.

Perhaps we nead a simple ostrstream ?


Rudolf Weber Informatik- und Netzwerkverein Ravensburg e.V