Tony Mountifield
2020-Jun-03 10:18 UTC
[asterisk-users] problem with logger: syslog vs. file
In article <88f96e46-e6bb-a7ef-bebb-5588ef6cd6c1 at gmx.ch>, Fourhundred Thecat <400thecat at gmx.ch> wrote:> > On 2020-06-02 17:48, Tony Mountifield wrote: > > In article <94191802-6c9c-bdab-615b-001786a2a0ca at gmx.ch>, > > Fourhundred Thecat <400thecat at 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.I have no idea, I'm not part of Asterisk development. I suspect that each logging type was added separately by different people, and it just happened.> If I am right, and this is a bug, then I would like to suggest this > should be fixed.I would agree that the fact the two logging types show different information is a bug, and you could report it at https://issues.asterisk.org/ However, the conversation would then be: should both logging types include line number and function? should both logging types omit them? should it be a configuration option in logger.conf whether they include or omit? if so, what should the default be, if not specified in logger.conf?> I am grateful for asterisk, and I want to help improve, even if in a > small way.Indeed! Cheers Tony -- Tony Mountifield Work: tony at softins.co.uk - http://www.softins.co.uk Play: tony at mountifield.org - http://tony.mountifield.org
Fourhundred Thecat
2020-Jun-03 10:24 UTC
[asterisk-users] problem with logger: syslog vs. file
> On 2020-06-03 12:18, Tony Mountifield wrote: > In article <88f96e46-e6bb-a7ef-bebb-5588ef6cd6c1 at gmx.ch>, > > However, the conversation would then be: should both logging types include > line number and function? should both logging types omit them? should > it be a configuration option in logger.conf whether they include or omit? > if so, what should the default be, if not specified in logger.conf?that's easy! log level should be configurable in config file, not hardcoded. Logging debugging info in production environment is madness.
On Wed, 3 Jun 2020, Fourhundred Thecat wrote:>> On 2020-06-03 12:18, Tony Mountifield wrote: >> In article <88f96e46-e6bb-a7ef-bebb-5588ef6cd6c1 at gmx.ch>, >> >> However, the conversation would then be: should both logging types include >> line number and function? should both logging types omit them? should >> it be a configuration option in logger.conf whether they include or omit? >> if so, what should the default be, if not specified in logger.conf? > > that's easy! > > log level should be configurable in config file, not hardcoded. > > Logging debugging info in production environment is madness.How about: syslog.local0 = error,verbose,warning no debugging detail. syslog.local0 = debug,error,verbose,warning include debugging detail. -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST https://www.linkedin.com/in/steve-edwards-4244281