[asterisk-dev] [svn-commits at lists.digium.com: [svn-commits] dhubbard: branch 1.4 r112689 - /branches/1.4/main/asterisk.c]
Daniel Hazelbaker
daniel at highdesertchurch.com
Mon Apr 7 16:44:31 CDT 2008
On Apr 5, 2008, at 9:09 PM, Tzafrir Cohen wrote:
> Asterisk does provide an extensive lgging facility. Have you niticed
> where that code is added? right after initializing the logger, in
> order
> to get those messages logged.
>
> With th default configuration of Asterisk, /var/log/asterisk/
> messages is
> a handy tool for debugging error.
>
> On my system the mailer has a separate mail.log, mail.warn and
> mail.err
> log files. You can easily do the same with asterisk with trivial
> logger.conf config lines:
>
> # the default:
> messages => error,warning,notice
>
> # Add those:
> warn => error,warning
> err => error
Yes, but unless I am missing something, none of those logging
facilities goes to the startup console or the "linux text
console" (i.e. the place messages like "/dev/hda I/O error" to spat
out to). When I run 'service asterisk start' I get no indication that
massive parts of my configuration may not work. I could have a
complete failure in my SIP, IAX and Zaptel (such as kernel modules not
loading) configuration and never know it until somebody complains that
they can't dial.
The asterisk startup script happily reports "[SUCCESS]" (or other
message depending on distro) and you never see a message unless you go
look at the log file. Right now I am sure you could do it via syslog,
but I have a hard enough time figuring out "normal" syslog usage. And
I don't want my console spammed every time Asterisk has an "error",
just at startup.
> One might say that some of Asterisk's error messages are mis-labeled.
> I'm sure that after using Asterisk with such a log file you'll be able
> to file a number of useful bug reports.
I would agree with that. I find it highly annoying that Asterisk
considers the fact that I did not turn off the meetme module at
compile time and do not have a meetme.conf configuration file it's
highest error code. I don't suppose there would be an easy way to
"map" log messages to a different error-code level so I can elevate
certain error messages and de-elevate others without keeping a custom
patch around?
> The console is intended for recieving immediate information. Not
> after-the-fact log messages. This is also why console messages have no
> time-stamp by default (this saves in size and makes the message mor
> readable). You normaly "see" the timing, anyway.
Perhaps our terminology is not matching up. When I was referring to
(startup) console in my previous message I was talking about the /dev/
pts/1 type console, not the asterisk logging console. The /dev/pts/1
console is where I would like to see error messages during startup so
that when I type 'service asterisk start' I will immediately see that
there were errors I need to look into.
> Tzafrir Cohen
Daniel
More information about the asterisk-dev
mailing list