Is there a way to get a sensible amount of logging done from kamailio?
Being new to the VoIP space (but with plenty of experience with i.e. web and email servers) I tried to get a running system by installing the kamailio package and starting up, trying to get it to behave by looking at log output. I use the blink SIP client in OSX, that has a SIP data dump log view and from that I can deduce that the server returns "SIP/2.0 483 Too Many Hops", however there is nothing helpful in the server logs.
If I set debug=2 i get nothing useful, and if I set debug=3 I get insane amounts of logging, thousands of lines per connection attempt. Finding something meaningful in there seems like a herculean task.
/noa
ps. The actual problem with 483 Too Many Hops sounded a lot like 'Mail loops back to myself' that you get on smtp servers when the relevant virtual domain is not configured, so it seems I was able to handle that problem by adding WITH_MULTIDOMAIN and configuring my domain with kamctl domain add. Now I get "482 Loop Detected" instead, which seems like a non-fatal condition. The logging question still stands though.
Hi Noa,
Pretty much the only reasonable way to do it is to throw your own xlog() statements into the default config, which contain the information you want.
The development community reasons that everyone is going to want different logging points and different content in those logs, so it is not necessarily appropriate to impose.
I would say throw a couple of xlog() statements in the config, maybe like this:
xlog("L_INFO", "($ci) Entering NAT handler\n");
(logging the Call-ID lets you trace what happened to a single "call" that shares Call-ID across all requests and replies)
Then, direct the output to a custom log file for easy viewing. Set the syslog logging facility to, say, LOG_LOCAL0, and then redirect the LOCAL0 facility in your syslog daemon to a separate file, e.g. in the case of /etc/rsyslog.conf or Debian-style /etc/sysklogd.conf or classic /etc/syslog.conf:
local0.* -/var/log/kamailio.log
Then restart the syslog daemon, restart Kamailio, and see if you like what you get.
Cheers,
-- Alex
On 01/02/2011 02:48 PM, Noa Resare wrote:
Is there a way to get a sensible amount of logging done from kamailio?
Being new to the VoIP space (but with plenty of experience with i.e. web and email servers) I tried to get a running system by installing the kamailio package and starting up, trying to get it to behave by looking at log output. I use the blink SIP client in OSX, that has a SIP data dump log view and from that I can deduce that the server returns "SIP/2.0 483 Too Many Hops", however there is nothing helpful in the server logs.
If I set debug=2 i get nothing useful, and if I set debug=3 I get insane amounts of logging, thousands of lines per connection attempt. Finding something meaningful in there seems like a herculean task.
/noa
ps. The actual problem with 483 Too Many Hops sounded a lot like 'Mail loops back to myself' that you get on smtp servers when the relevant virtual domain is not configured, so it seems I was able to handle that problem by adding WITH_MULTIDOMAIN and configuring my domain with kamctl domain add. Now I get "482 Loop Detected" instead, which seems like a non-fatal condition. The logging question still stands though.
-- Everything is secret.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Additionally, for plain SIP traces, you can use the siptrace module.
regards klaus
Am 02.01.2011 20:52, schrieb Alex Balashov:
Hi Noa,
Pretty much the only reasonable way to do it is to throw your own xlog() statements into the default config, which contain the information you want.
The development community reasons that everyone is going to want different logging points and different content in those logs, so it is not necessarily appropriate to impose.
I would say throw a couple of xlog() statements in the config, maybe like this:
xlog("L_INFO", "($ci) Entering NAT handler\n");
(logging the Call-ID lets you trace what happened to a single "call" that shares Call-ID across all requests and replies)
Then, direct the output to a custom log file for easy viewing. Set the syslog logging facility to, say, LOG_LOCAL0, and then redirect the LOCAL0 facility in your syslog daemon to a separate file, e.g. in the case of /etc/rsyslog.conf or Debian-style /etc/sysklogd.conf or classic /etc/syslog.conf:
local0.* -/var/log/kamailio.log
Then restart the syslog daemon, restart Kamailio, and see if you like what you get.
Cheers,
-- Alex
On 01/02/2011 02:48 PM, Noa Resare wrote:
Is there a way to get a sensible amount of logging done from kamailio?
Being new to the VoIP space (but with plenty of experience with i.e. web and email servers) I tried to get a running system by installing the kamailio package and starting up, trying to get it to behave by looking at log output. I use the blink SIP client in OSX, that has a SIP data dump log view and from that I can deduce that the server returns "SIP/2.0 483 Too Many Hops", however there is nothing helpful in the server logs.
If I set debug=2 i get nothing useful, and if I set debug=3 I get insane amounts of logging, thousands of lines per connection attempt. Finding something meaningful in there seems like a herculean task.
/noa
ps. The actual problem with 483 Too Many Hops sounded a lot like 'Mail loops back to myself' that you get on smtp servers when the relevant virtual domain is not configured, so it seems I was able to handle that problem by adding WITH_MULTIDOMAIN and configuring my domain with kamctl domain add. Now I get "482 Loop Detected" instead, which seems like a non-fatal condition. The logging question still stands though.
-- Everything is secret.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On 01/02/2011 09:52 PM, Alex Balashov wrote:
Hi Noa,
Then, direct the output to a custom log file for easy viewing. Set the syslog logging facility to, say, LOG_LOCAL0, and then redirect the LOCAL0 facility in your syslog daemon to a separate file, e.g. in the case of /etc/rsyslog.conf or Debian-style /etc/sysklogd.conf or classic /etc/syslog.conf:
local0.* -/var/log/kamailio.log
Hello
The - in front of the path means that syslog logging is performed asynchronous, which is very useful(read mandatory) if you plan to use logging and kamailio in anything except a basic test case.
If you want a trace of the messages you can use ngrep:
`ngrep -W byline -d any sip port 5060 ` where "sip" is a regex to match and "port 5060" is a pcap expression (see tcpdump as well)
Marius Marius
Then restart the syslog daemon, restart Kamailio, and see if you like what you get.
Cheers,
-- Alex
On 01/02/2011 02:48 PM, Noa Resare wrote:
Is there a way to get a sensible amount of logging done from kamailio?
Being new to the VoIP space (but with plenty of experience with i.e. web and email servers) I tried to get a running system by installing the kamailio package and starting up, trying to get it to behave by looking at log output. I use the blink SIP client in OSX, that has a SIP data dump log view and from that I can deduce that the server returns "SIP/2.0 483 Too Many Hops", however there is nothing helpful in the server logs.
If I set debug=2 i get nothing useful, and if I set debug=3 I get insane amounts of logging, thousands of lines per connection attempt. Finding something meaningful in there seems like a herculean task.
/noa
ps. The actual problem with 483 Too Many Hops sounded a lot like 'Mail loops back to myself' that you get on smtp servers when the relevant virtual domain is not configured, so it seems I was able to handle that problem by adding WITH_MULTIDOMAIN and configuring my domain with kamctl domain add. Now I get "482 Loop Detected" instead, which seems like a non-fatal condition. The logging question still stands though.
-- Everything is secret.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On 02.01.2011 20:48, Noa Resare wrote:
Is there a way to get a sensible amount of logging done from kamailio?
Being new to the VoIP space (but with plenty of experience with i.e. web and email servers) I tried to get a running system by installing the kamailio package and starting up, trying to get it to behave by looking at log output. I use the blink SIP client in OSX, that has a SIP data dump log view and from that I can deduce that the server returns "SIP/2.0 483 Too Many Hops", however there is nothing helpful in the server logs.
If I set debug=2 i get nothing useful, and if I set debug=3 I get insane amounts of logging, thousands of lines per connection attempt. Finding something meaningful in there seems like a herculean task.
I agree with you that debug level 3+ is not for the faint of heart due to the fact that every single module turns very verbose at these levels. What I'd found really useful to have is module- and core-specific log switching; that is, be able to set debug levels on a per-module basis in addition to turning it on and off in the Kamailio core. That would surely ease finding issues when you know that a problem is likely related to a specific (set of) module(s), especially in a high-load productive environment.
Not sure about the feasibility of such a change and possible implications to overall runtime but I suppose it could be done in a performance-friendly fashion.
Cheers,
--Timo