Bogdan,

We are using supervisord to start OpenSIPS and it is configured to redirect 
stdout/stderr to a log file. The vendor application is streaming that log file. 
Supervisord does not provide any log manipulation functionality. The only way I 
can see is that we would have to write another application to read the 
supervisord logs, parse them, and write them to yet another log file which the 
vendor application can read. This is a very undesirable solution as it only 
adds complexity and another failure point to the system. We were doing it this 
way specifically to avoid syslog and this extra data being printed.

I think it’s a useful functionality for any platform to provide logging 
features that log only what the user has requested without any additional 
output being unexpectedly added, or at least to make the logging of that extra 
data configurable. Not doing so is making the assumption that all users of the 
platform will want their logs to look the way the developers of the platform 
think they should. The formatted date/time string and process ID are already 
available from the script variables should users choose to add it to their logs.

Since we are compiling OpenSIPS, if there is no desire to address this 
officially then I will probably pursue a local patch that will remove the extra 
output rather than injecting another application into our log process.

Thanks,
Ben Newlin

From: Bogdan-Andrei Iancu <bog...@opensips.org>
Date: Thursday, April 19, 2018 at 3:47 AM
To: Ben Newlin <ben.new...@genesys.com>, OpenSIPS users mailling list 
<users@lists.opensips.org>
Subject: Re: [OpenSIPS-Users] xlog adding information to output

Hi Ben,

And there is no way to insert something between opensips and the collector in 
order to do some text processing. I mean, how does the vendor's collector 
attaches to the stderror ? You start opensips within other app ? or ?

Best regards,


Bogdan-Andrei Iancu



OpenSIPS Founder and Developer

  http://www.opensips-solutions.com<http://www.opensips-solutions.com>

OpenSIPS Summit 2018

  
http://www.opensips.org/events/Summit-2018Amsterdam<http://www.opensips.org/events/Summit-2018Amsterdam>
On 04/18/2018 03:30 PM, Ben Newlin wrote:
Bogdan,

We collect the logs via stdout/stderr.

Thanks,
Ben Newlin

From: Bogdan-Andrei Iancu <bog...@opensips.org><mailto:bog...@opensips.org>
Date: Wednesday, April 18, 2018 at 5:37 AM
To: Ben Newlin <ben.new...@genesys.com><mailto:ben.new...@genesys.com>, 
OpenSIPS users mailling list 
<users@lists.opensips.org><mailto:users@lists.opensips.org>
Subject: Re: [OpenSIPS-Users] xlog adding information to output

Hi Ben,

And how do you capture and deliver the logs to this vendor? still via syslog ? 
or via stderr?

Regards,



Bogdan-Andrei Iancu



OpenSIPS Founder and Developer

  http://www.opensips-solutions.com<http://www.opensips-solutions.com>

OpenSIPS Summit 2018

  
http://www.opensips.org/events/Summit-2018Amsterdam<http://www.opensips.org/events/Summit-2018Amsterdam>
On 04/13/2018 04:47 PM, Ben Newlin wrote:
Bogdan,

I can understand the desire for consistency.

Unfortunately in our case we are using an external log service vendor and the 
application that is collecting the logs is provided by them. It simply collects 
all logs and does not have any option to preprocess individual log entries. We 
don’t have the ability to pre-process the logs prior to ingestion. We can, I 
think, filter out the extra info while searching the logs, but it will make the 
searches more complex and slower.

It would be nice to be able to disable this so there is some option to only log 
what is provided without manipulation. It could be a flag that affects xlog, or 
a different log function that doesn’t use the prefix. If you think it is 
worthy, I’d be happy to open a feature request.

Thanks,
Ben Newlin

From: Bogdan-Andrei Iancu <bog...@opensips.org><mailto:bog...@opensips.org>
Date: Thursday, April 12, 2018 at 4:02 PM
To: OpenSIPS users mailling list 
<users@lists.opensips.org><mailto:users@lists.opensips.org>, Ben Newlin 
<ben.new...@genesys.com><mailto:ben.new...@genesys.com>
Subject: Re: [OpenSIPS-Users] xlog adding information to output

Hi Ben,

Yes, this change was done on purpose for logs consistency reasons. As when you 
log via syslog you will get *all* the time the process name, pid and data as 
suffix, we considered that printing to strerr should follow the same model and 
have *all* the time the same prefix for the messages.

Now, I guess you grep the logs by some sort of an application (before having 
them pushed as jsons for later processing) - maybe you can do some extra 
pre-processing the strip the prefix before parsing it as json.

Regards,




Bogdan-Andrei Iancu



OpenSIPS Founder and Developer

  http://www.opensips-solutions.com<http://www.opensips-solutions.com>

OpenSIPS Summit 2018

  
http://www.opensips.org/events/Summit-2018Amsterdam<http://www.opensips.org/events/Summit-2018Amsterdam>
On 04/06/2018 10:58 PM, Ben Newlin wrote:
Hi,

Yet another question. ☺

We use the json module to structure our output to and then print using xlog. 
Our log consumer processes the json format and can process and index our logs.

It appears that in 2.x the xlog module now always prepends a date string and 
the process number before every log. This is causing the logs to not be valid 
json format and they are not parsed properly by our consumer.

I know that OpenSIPS’ internal logs always print in this format with the date 
and process number in front. Was this an intentional change to make xlog print 
this way as well? Can it be disabled in any way?

I’m pretty sure I remember someone else asking about this not too long ago but 
I couldn’t find the thread in the archive.

Thanks,
Ben Newlin







_______________________________________________

Users mailing list

Users@lists.opensips.org<mailto:Users@lists.opensips.org>

http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users>









_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to