Re: [asterisk-users] problem with logger: syslog vs. file

2020-06-02 Thread Fourhundred Thecat

> On 2020-06-02 17:48, Tony Mountifield wrote:

In article <94191802-6c9c-bdab-615b-001786a2a...@gmx.ch>,
Fourhundred Thecat <400the...@gmx.ch> wrote:

  > On 2019-11-16 03:29, Fourhundred Thecat wrote:




case LOGTYPE_SYSLOG:
  snprintf(buf, size, "%s[%d]%s: %s:%d in %s: %s",
   levels[msg->level], msg->lwp, call_identifier_str,
msg->file, msg->line, msg->function, msg->message);
  term_strip(buf, buf, size);
  break;

case LOGTYPE_FILE:
  snprintf(buf, size, "[%s] %s[%d]%s %s: %s",
msg->date, msg->level_name, msg->lwp,
call_identifier_str, msg->file, msg->message);
  term_strip(buf, buf, size);
  break;


so basically, it is hardcoded that logging to syslog adds extra
msg->line and msg->function.

why would anybody do that ?

This seems to me like a very unfortunate decision.
Is there a reason for this ?
Am I missing something?


But someone with a different opinion than yours might well say "Why did
they decide to omit the line number and function from the file logging?
It's very useful information!"

The beauty of open source is of course that if you feel strongly enough,
you can modify the source file before you build it, so it shows just
what you want.


I know I can patch asterisk and compile myself. I did it in the past,
and it is tedious to keep own patches and manage own packages. Its last
resort for me.

Anyway, I am asking weather there is a reason why this particular
decision was taken. To me perosnally it seems like idiocy, but I am not
developer and maybe I am missing something.

If I am right, and this is a bug, then I would like to suggest this
should be fixed.

I am grateful for asterisk, and I want to help improve, even if in a
small way.



--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] problem with logger: syslog vs. file

2020-06-02 Thread Tony Mountifield
In article <94191802-6c9c-bdab-615b-001786a2a...@gmx.ch>,
Fourhundred Thecat <400the...@gmx.ch> wrote:
>  > On 2019-11-16 03:29, Fourhundred Thecat wrote:
> > Hello,
> >
> > I am logging directly into file and also to syslog.
> > Here is snippet from my /etc/asterisk/logger.conf:
> >
> >   messages => notice,warning,error,verbose
> > syslog.local0 => notice,warning,error,verbose
> >
> > But the logs look different:
> >
> >VERBOSE[7609][C-0013]  pbx.c:
> >NOTICE[3042] chan_sip.c: Peer '' is now UNREACHABLE!
> >
> > vs.
> >
> >VERBOSE[7609][C-0013]: pbx.c:2925 in pbx_extension_helper:
> >NOTICE[3042]: chan_sip.c:30421 in sip_poke_noanswer: Peer '8884' is
> > now UNREACHABLE!
> >
> > specifically, the messages coming from syslog have extra debugging
> > information (which I am not interested in):
> >
> >pbx.c:
> >chan_sip.c:
> >
> > vs .
> >
> >pbx.c:2925 in pbx_extension_helper:
> >chan_sip.c:30421 in sip_poke_noanswer:
> >
> > Why are same log level settings producing different logs?
> >
> > This is just making the log lines longer and less readable. It is just
> > bombarding me with useless information. I don't have debug set, so why
> > am I getting debug information? Who cares on which line in the .c file
> > the function is defined ?
> 
> I have reported the above problem twice, but unfortunately did not
> receive any feedback at all.
> 
> I believe I have now finally pinpointed the exact place in source code,
> where this is coming from. main/logger.c:
>   break;
> 
> 
> case LOGTYPE_SYSLOG:
>  snprintf(buf, size, "%s[%d]%s: %s:%d in %s: %s",
>   levels[msg->level], msg->lwp, call_identifier_str,
> msg->file, msg->line, msg->function, msg->message);
>  term_strip(buf, buf, size);
>  break;
> 
> case LOGTYPE_FILE:
>  snprintf(buf, size, "[%s] %s[%d]%s %s: %s",
>msg->date, msg->level_name, msg->lwp,
> call_identifier_str, msg->file, msg->message);
>  term_strip(buf, buf, size);
>  break;
> 
> 
> so basically, it is hardcoded that logging to syslog adds extra
> msg->line and msg->function.
> 
> why would anybody do that ?
> 
> This seems to me like a very unfortunate decision.
> Is there a reason for this ?
> Am I missing something?

I agree with you that it is strange the two logging types are different.

But someone with a different opinion than yours might well say "Why did
they decide to omit the line number and function from the file logging?
It's very useful information!"

The beauty of open source is of course that if you feel strongly enough,
you can modify the source file before you build it, so it shows just
what you want.

Cheers
Tony
-- 
Tony Mountifield
Work: t...@softins.co.uk - http://www.softins.co.uk
Play: t...@mountifield.org - http://tony.mountifield.org

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] problem with logger: syslog vs. file

2020-06-02 Thread Fourhundred Thecat

> On 2019-11-16 03:29, Fourhundred Thecat wrote:

Hello,

I am logging directly into file and also to syslog.
Here is snippet from my /etc/asterisk/logger.conf:

  messages => notice,warning,error,verbose
syslog.local0 => notice,warning,error,verbose

But the logs look different:

   VERBOSE[7609][C-0013]  pbx.c:
   NOTICE[3042] chan_sip.c: Peer '' is now UNREACHABLE!

vs.

   VERBOSE[7609][C-0013]: pbx.c:2925 in pbx_extension_helper:
   NOTICE[3042]: chan_sip.c:30421 in sip_poke_noanswer: Peer '8884' is
now UNREACHABLE!

specifically, the messages coming from syslog have extra debugging
information (which I am not interested in):

   pbx.c:
   chan_sip.c:

vs .

   pbx.c:2925 in pbx_extension_helper:
   chan_sip.c:30421 in sip_poke_noanswer:

Why are same log level settings producing different logs?

This is just making the log lines longer and less readable. It is just
bombarding me with useless information. I don't have debug set, so why
am I getting debug information? Who cares on which line in the .c file
the function is defined ?


I have reported the above problem twice, but unfortunately did not
receive any feedback at all.

I believe I have now finally pinpointed the exact place in source code,
where this is coming from. main/logger.c:
break;


case LOGTYPE_SYSLOG:
snprintf(buf, size, "%s[%d]%s: %s:%d in %s: %s",
 levels[msg->level], msg->lwp, call_identifier_str,
msg->file, msg->line, msg->function, msg->message);
term_strip(buf, buf, size);
break;

case LOGTYPE_FILE:
snprintf(buf, size, "[%s] %s[%d]%s %s: %s",
  msg->date, msg->level_name, msg->lwp,
call_identifier_str, msg->file, msg->message);
term_strip(buf, buf, size);
break;


so basically, it is hardcoded that logging to syslog adds extra
msg->line and msg->function.

why would anybody do that ?

This seems to me like a very unfortunate decision.
Is there a reason for this ?
Am I missing something?

than you,

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] UNSUBSCRIBE

2020-06-02 Thread Antony Stone
On Tuesday 02 June 2020 at 11:18:11, Edgar wrote:

> -- 
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> 
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
> 
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

Please see the above footer, as shown on all list emails.


Regards,


Antony.

-- 
Pavlov is in the pub enjoying a pint.
The barman rings for last orders, and Pavlov jumps up exclaiming "Damn!  I 
forgot to feed the dog!"

   Please reply to the list;
 please *don't* CC me.

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] UNSUBSCRIBE

2020-06-02 Thread Edgar
 

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users