Question

I am trying to implement module for Kamailio by extending "topoh" module. I want to write something console so I know that module is correctly loaded and in use. For that purpose I am using logging functions LM_DBG and LM_ERR. In the following article http://www.kamailio.org/dokuwiki/doku.php/tutorials:debug-syslog-messages stays that output from this functions goes to syslog but I can't see anything in my syslog. I am using command tail -F /var/log/syslog for viewing syslog.

I am using default settings for debugging in my Kamailio config file. Is there something special that I must configure for view output from this logging functions in my syslog?

Was it helpful?

Solution 2

So, I was able to see output from LM_DBG and LM_ERR macros after changing debugging level to 3 in kamailio.cfg. Than I put together this command to grep all my "logs" to log file:

kamailio 2>&1 >/dev/null | grep --line-buffered "name_of_your_module" > name_of_your_module.log

Than I can simply watch my debug information information live with command tail -F name_of_your_module.log.

I hope that this help someone in the future.

OTHER TIPS

Note that CentOS, Fedora ans other Linux distributions write the log messages to /var/log/messages.

Anyhow, you can set log_stderror=yes in your kamailio.cfg or start kamailio with -E command line parameter to see the log messages in the terminal. In that way you can check if your LM_ERR() or LM_DBG() lines are executed.

Also, be aware that LM_DBG() output is printed only when debug=3 or higher in kamailio.cfg, or you give -ddd as parameter in command line.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top