<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Apple Color Emoji";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Courier New \,serif";
        panose-1:2 7 3 9 2 2 5 2 4 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New",serif;}
tt
        {mso-style-priority:99;
        font-family:"Courier New",serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle23
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle24
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Bogdan,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black">Ben Newlin</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="color:black">From: </span></b><span style="color:black">Bogdan-Andrei Iancu <bogdan@opensips.org><br>
<b>Date: </b>Thursday, April 19, 2018 at 3:47 AM<br>
<b>To: </b>Ben Newlin <Ben.Newlin@genesys.com>, OpenSIPS users mailling list <users@lists.opensips.org><br>
<b>Subject: </b>Re: [OpenSIPS-Users] xlog adding information to output<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><tt><span style="font-size:10.0pt">Hi Ben,</span></tt><span style="font-size:10.0pt;font-family:"Courier New",serif"><br>
<br>
<tt>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 ?</tt><br>
<br>
<tt>Best regards,</tt></span><br>
<br>
<o:p></o:p></p>
<pre>Bogdan-Andrei Iancu<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>OpenSIPS Founder and Developer<o:p></o:p></pre>
<pre>  <a href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a><o:p></o:p></pre>
<pre>OpenSIPS Summit 2018<o:p></o:p></pre>
<pre>  <a href="http://www.opensips.org/events/Summit-2018Amsterdam">http://www.opensips.org/events/Summit-2018Amsterdam</a><o:p></o:p></pre>
<div>
<p class="MsoNormal">On 04/18/2018 03:30 PM, Ben Newlin wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="font-size:11.0pt">Bogdan,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">We collect the logs via stdout/stderr.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black">Thanks,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black">Ben Newlin</span><o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="color:black">From: </span></b><span style="color:black">Bogdan-Andrei Iancu
<a href="mailto:bogdan@opensips.org"><bogdan@opensips.org></a><br>
<b>Date: </b>Wednesday, April 18, 2018 at 5:37 AM<br>
<b>To: </b>Ben Newlin <a href="mailto:Ben.Newlin@genesys.com"><Ben.Newlin@genesys.com></a>, OpenSIPS users mailling list
<a href="mailto:users@lists.opensips.org"><users@lists.opensips.org></a><br>
<b>Subject: </b>Re: [OpenSIPS-Users] xlog adding information to output</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
<p class="MsoNormal"><tt><span style="font-size:10.0pt">Hi Ben,</span></tt><span style="font-size:10.0pt;font-family:"Courier New ,serif",serif"><br>
<br>
</span><tt><span style="font-size:10.0pt">And how do you capture and deliver the logs to this vendor? still via syslog ? or via stderr?</span></tt><span style="font-size:10.0pt;font-family:"Courier New ,serif",serif"><br>
<br>
</span><tt><span style="font-size:10.0pt">Regards,</span></tt><span style="font-size:10.0pt;font-family:"Courier New ,serif",serif"><br>
<br>
<br>
</span><o:p></o:p></p>
<pre>Bogdan-Andrei Iancu<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>OpenSIPS Founder and Developer<o:p></o:p></pre>
<pre>  <a href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a><o:p></o:p></pre>
<pre>OpenSIPS Summit 2018<o:p></o:p></pre>
<pre>  <a href="http://www.opensips.org/events/Summit-2018Amsterdam">http://www.opensips.org/events/Summit-2018Amsterdam</a><o:p></o:p></pre>
<div>
<p class="MsoNormal">On 04/13/2018 04:47 PM, Ben Newlin wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="font-size:11.0pt">Bogdan,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I can understand the desire for consistency.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">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.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">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.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black">Thanks,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black">Ben Newlin</span><o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="color:black">From: </span></b><span style="color:black">Bogdan-Andrei Iancu
<a href="mailto:bogdan@opensips.org"><bogdan@opensips.org></a><br>
<b>Date: </b>Thursday, April 12, 2018 at 4:02 PM<br>
<b>To: </b>OpenSIPS users mailling list <a href="mailto:users@lists.opensips.org">
<users@lists.opensips.org></a>, Ben Newlin <a href="mailto:Ben.Newlin@genesys.com">
<Ben.Newlin@genesys.com></a><br>
<b>Subject: </b>Re: [OpenSIPS-Users] xlog adding information to output</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
<p class="MsoNormal"><a name="_MailOriginalBody"><tt><span style="font-size:10.0pt">Hi Ben,</span></tt></a><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New ,serif",serif"><br>
<br>
</span></span><span style="mso-bookmark:_MailOriginalBody"><tt><span style="font-size:10.0pt">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.</span></tt></span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New ,serif",serif"><br>
<br>
</span></span><span style="mso-bookmark:_MailOriginalBody"><tt><span style="font-size:10.0pt">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.</span></tt></span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New ,serif",serif"><br>
<br>
</span></span><span style="mso-bookmark:_MailOriginalBody"><tt><span style="font-size:10.0pt">Regards,</span></tt></span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:10.0pt;font-family:"Courier New ,serif",serif"><br>
<br>
<br>
<br>
</span><o:p></o:p></span></p>
<pre><span style="mso-bookmark:_MailOriginalBody">Bogdan-Andrei Iancu<o:p></o:p></span></pre>
<pre><span style="mso-bookmark:_MailOriginalBody"> <o:p></o:p></span></pre>
<pre><span style="mso-bookmark:_MailOriginalBody">OpenSIPS Founder and Developer<o:p></o:p></span></pre>
<pre><span style="mso-bookmark:_MailOriginalBody">  </span><a href="http://www.opensips-solutions.com"><span style="mso-bookmark:_MailOriginalBody">http://www.opensips-solutions.com</span><span style="mso-bookmark:_MailOriginalBody"></span></a><span style="mso-bookmark:_MailOriginalBody"><o:p></o:p></span></pre>
<pre><span style="mso-bookmark:_MailOriginalBody">OpenSIPS Summit 2018<o:p></o:p></span></pre>
<pre><span style="mso-bookmark:_MailOriginalBody">  </span><a href="http://www.opensips.org/events/Summit-2018Amsterdam"><span style="mso-bookmark:_MailOriginalBody">http://www.opensips.org/events/Summit-2018Amsterdam</span><span style="mso-bookmark:_MailOriginalBody"></span></a><span style="mso-bookmark:_MailOriginalBody"><o:p></o:p></span></pre>
<div>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody">On 04/06/2018 10:58 PM, Ben Newlin wrote:<o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:11.0pt">Hi,</span><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:11.0pt"> </span><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:11.0pt">Yet another question.
</span></span><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:11.0pt;font-family:"Apple Color Emoji",serif">☺</span><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:11.0pt"> </span><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:11.0pt">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.</span><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:11.0pt"> </span><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:11.0pt">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.</span><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:11.0pt"> </span><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:11.0pt">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?</span><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:11.0pt"> </span><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:11.0pt">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.</span><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:11.0pt"> </span><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:11.0pt;color:black">Thanks,</span><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:11.0pt;color:black">Ben Newlin</span><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:11.0pt"><br>
<br>
<br>
<br>
<br>
</span><o:p></o:p></span></p>
<pre><span style="mso-bookmark:_MailOriginalBody">_______________________________________________<o:p></o:p></span></pre>
<pre><span style="mso-bookmark:_MailOriginalBody">Users mailing list<o:p></o:p></span></pre>
<pre><span style="mso-bookmark:_MailOriginalBody"></span><a href="mailto:Users@lists.opensips.org"><span style="mso-bookmark:_MailOriginalBody">Users@lists.opensips.org</span><span style="mso-bookmark:_MailOriginalBody"></span></a><span style="mso-bookmark:_MailOriginalBody"><o:p></o:p></span></pre>
<pre><span style="mso-bookmark:_MailOriginalBody"></span><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"><span style="mso-bookmark:_MailOriginalBody">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</span><span style="mso-bookmark:_MailOriginalBody"></span></a><span style="mso-bookmark:_MailOriginalBody"><o:p></o:p></span></pre>
</blockquote>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:11.0pt"><br>
<br>
<br>
<br>
</span><o:p></o:p></span></p>
</blockquote>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:11.0pt"><br>
<br>
<br>
</span><o:p></o:p></span></p>
</blockquote>
<p class="MsoNormal"><span style="mso-bookmark:_MailOriginalBody"><span style="font-size:11.0pt"><br>
<br>
</span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
</body>
</html>