<div dir="ltr">See reply inline below,<br><div class="gmail_extra"><br></div><div class="gmail_extra">Thank you.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 4, 2014 at 12:08 PM, aawaise <span dir="ltr"><<a href="mailto:owaisulhaq@hotmail.com" target="_blank">owaisulhaq@hotmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I want to ask some queries regarding logging in kamailio.<br>
<br>
1. First of all if I want to add LM_DBG or LM_ERR in lookup.c file of<br>
registrar module, where to add the command as on extraction of<br>
kamailio-3.1.1.zip, I found registrar module files in modules_k folder as<br>
well as modules_s folder.<br></blockquote><div><br>[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.<br>

<br><a href="http://kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x#loadpath">http://kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x#loadpath</a><br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


2. I was advised to us macros from dprint.h to see LM_DBG and LM_ERR<br>
statements in log file, how to do so ??<br></blockquote><div><br>[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).<br>

<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
3. Third, will these logs also print in /var/log/messages in debian linux<br>
along with other kamailio.cfg logs ??<br></blockquote><div><br></div><div>[Muhammad]: Yes, you can see log messages under log facility defined in kamailio.cfg with "log_facility".<br></div><div><br><a href="http://kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x#log_facility">http://kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x#log_facility</a><br>

<br>However, do note that logs printed in syslog will depend on log level defined with "debug" global variable,<br><br><a href="http://kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x#debug">http://kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x#debug</a><br>

<br></div><div>Therefore, if for example, log level is set to L_INFO then logs of type L_DBG won't print to syslog.<br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


4. What changes should be made in kamailio.cfg to see these logs, i.e log<br>
level etc ??<br></blockquote><div><br></div><div>[Muhammad]: set "debug" global config variable to appropriate value as explained above.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


<br>
Any help will be highly appreciated. Thanks.<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://sip-router.1086192.n5.nabble.com/LM-ERR-and-LM-DBG-tp129392.html" target="_blank">http://sip-router.1086192.n5.nabble.com/LM-ERR-and-LM-DBG-tp129392.html</a><br>
Sent from the Users mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div><br></div></div>