[Liblogging-users] liblogging Cooked-initiator
Brought to you by:
rgerhards
From: <SF...@ao...> - 2005-05-10 07:24:32
|
This list doesn't seem to be much used... I've set up a syslog COOKED initiator with liblogging library on Windows 98, visual c++ v6. My listener is a SBSCsyslogd on a redhat station. I have used a program called prjconverter to convert the liblogging project files from vcpp7 (sln & vcproj) into vcpp6 (dsp & dsw). It works really fine. I use TestDrvr.c as a model to build my initiator. I have set my srOPTION_3195_ALLOWED_CLIENT_PROFILES option to USE_3195_PROFILE_COOKED_ONLY. (Anyway, my listener accepts only COOKED messages). The interoperability with the SBSC listener works fine. I still have a little problem. I use the function srSLMGFormatRawMsg (from syslogmessage.c) to format the message. There is no srSLMGFormatCookedMsg function. This function is necessary because it sets the timestamp (and allocates memory for it). If I don't call it, I have an error when building the COOKED message in the function sbPSRCClntSendSLMG of clntprof-3195cooked.c because it tries to append a NULL string to the message: the pszTimeStamp which has not been created. Furthermore, it puts the message text into the sending buffer. This function (srSLMGFormatRawMsg) also adds a RAW header to the message which is no use for COOKED messages. RAW profile uses BSD syslog headers whereas Cooked uses the attributes of the "entry" XML element. I obtain a message with an "entry" element with the timestamp, severity, hostname, etc and in this element, I have a RAW message with, again, the timestamp, severity, hostname and so on. I think the profile used should be matched in that function and in the cooked case, no header should be added. (What about calling it srSLMGFormatMsg?) The other solution would be to externalyse the tasks needed for RAM & Cooked profiles from that function. MC |