See reply inline below,
Thank you.
On Mon, Aug 4, 2014 at 12:08 PM, aawaise <owaisulhaq(a)hotmail.com> wrote:
I want to ask some queries regarding logging in
kamailio.
1. First of all if I want to add LM_DBG or LM_ERR in lookup.c file of
registrar module, where to add the command as on extraction of
kamailio-3.1.1.zip, I found registrar module files in modules_k folder as
well as modules_s folder.
[Muhammad]: better use latest version of kamailio, i.e. 1.4.x instead of
older versions. If you insist on using older version them you can use mpath
or loadpath kamailio.cfg to select which module you want to use, i.e SER
module or Kamailio module. If both are specified in mpath or loadpath then
first one will be used.
http://kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x#loadpath
2. I was advised to us macros from dprint.h to see LM_DBG and LM_ERR
statements in log file, how to do so ??
[Muhammad]: the syntax of LM_ERR and LM_DBG is similar to printf, so if you
know how to use standard C method printf, you should understand how these
will work. In case you do not understand printf syntax, i strongly
recommend NOT to touch kamailio's native code (the .c or .h files).
3. Third, will these logs also print in /var/log/messages in debian linux
along with other kamailio.cfg logs ??
[Muhammad]: Yes, you can see log messages under log facility defined in
kamailio.cfg with "log_facility".
http://kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x#log_facility
However, do note that logs printed in syslog will depend on log level
defined with "debug" global variable,
http://kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x#debug
Therefore, if for example, log level is set to L_INFO then logs of type
L_DBG won't print to syslog.
4. What changes should be made in kamailio.cfg to see these logs, i.e log
level etc ??
[Muhammad]: set "debug" global config variable to appropriate value as
explained above.
Any help will be highly appreciated. Thanks.
--
View this message in context:
http://sip-router.1086192.n5.nabble.com/LM-ERR-and-LM-DBG-tp129392.html
Sent from the Users mailing list archive at
Nabble.com.
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users