[kea-dev] Logging in sample hook module - missing log/message_dictionary.h

Raj raj rajlistuser at gmail.com
Wed Sep 16 14:53:31 UTC 2015


Dear List,

I am following the Hooks developer guide, and am able to get the
sample module up and running. Next I am trying to get logging working
inside the hook. I have tried to follow the docs, but may have missed
some thing, In any case when I compile the code, I get the following
error:

# g++ -I /usr/local/include/kea/ -L /usr/local/lib/ -fpic -shared -o
example.so load_unload.cc hook_packet_capture.cc pkt4_send.cc
pkt_receive4.cc version.cc -lkea-dhcpsrv -lkea-dhcp++ -lkea-hooks
-lkea-log -lkea-util -lkea-exceptions
In file included from packet_capture_log.h:4:0,
                 from load_unload.cc:6:
/usr/local/include/kea/log/message_initializer.h:18:36: fatal error:
log/message_dictionary.h: No such file or directory
 #include <log/message_dictionary.h>
                                    ^
compilation terminated.
In file included from hook_packet_capture.cc:5:0:
/usr/local/include/kea/log/message_initializer.h:18:36: fatal error:
log/message_dictionary.h: No such file or directory
 #include <log/message_dictionary.h>
                                    ^
compilation terminated.

I have created  the packet_capture_log.h with same content as shown in
the doc and added the following section in the load_unload.cc

#include <packet_capture_log.h>
namespace packet_capture {
isc::log::Logger packet_capture_logger("packet-capture");
}

I have created a sample message file with name hook_packet_capture.mes
with following content:

# Example message file
$NAMESPACE isc::log

% HOOK_FILE_STATUS file %1: return code '%2'
Return code of the hook file opening block

compiled the mes file using the following command:

# message hook_packet_capture.mes

and ran the g++ command to compile.

I am not sure if what I am doing is correct. Any help to resolve this
would be much appreciated.

Thanks and Regards,

Raj


More information about the kea-dev mailing list