<div dir="ltr">Hello Liviu,<div><br></div><div>As I mentioned before, on my config</div><div><b>debug=0,</b></div><div>the same shows `<b>opensipsctl fifo debug`</b></div><div>DEBUG:: 0</div><div><br></div><div>When I commented out debug parameter from config, on restart opensips logs the following:</div>
<div>-----------</div><div><div>==&gt; /var/log/sips.log &lt;==<br></div><div>local2.notice&lt;149&gt;: Aug 13 07:12:00 sip1 /usr/sbin/opensips[24117]: NOTICE:core:main: version: opensips 1.7.1-tls (x86_64/linux)</div><div>
local2.notice&lt;149&gt;: Aug 13 07:12:00 sip1 /usr/sbin/opensips[24117]: NOTICE:signaling:mod_init: initializing module ...</div><div>local2.warn&lt;148&gt;: Aug 13 07:12:00 sip1 /usr/sbin/opensips[24117]: WARNING:core:mk_net: invalid network address/netmask combination fixed...</div>
<div>local2.notice&lt;149&gt;: Aug 13 07:12:00 sip1 /usr/sbin/opensips[24121]: &nbsp;L_NOTICE using localhost for routing<br></div><div>local2.err&lt;147&gt;: Aug 13 07:12:00 sip1 /usr/sbin/opensips[24121]: &nbsp;no LEVEL using localhost for routing</div>
</div><div>----------------------------</div><div><br></div><div>So only 2 of 3 messages have been logged.&nbsp;</div><div><br></div><div>I found that it would prints all those 3 messages (as well as a lot of other INFO msgs :) if I put &#39;debug=3&#39; on config file.</div>
<div><br></div><div>From <a href="http://www.opensips.org/html/docs/modules/1.4.x/xlog.html">http://www.opensips.org/html/docs/modules/1.4.x/xlog.html</a> -&nbsp;</div><div><br></div><div>=========</div><div><br></div><div>&nbsp;xlog([level,] format)</div>
<div><div><br></div><div>Print a formated message using LOG function.</div><div>Meaning of the parameters are as follows:</div><div>level - The level that will be used in LOG function. It can be:</div><div><br></div><div>
L_ALERT - log level -3</div><div>L_CRIT - log level -2</div><div>L_ERR - log level -1</div><div>L_WARN - log level 1</div><div>L_NOTICE - log level 2</div><div>L_INFO - log level 3</div><div>L_DBG - log level 4</div><div>
If the log level is higher than the &ldquo;debug&rdquo; global parameter, the message is not printed to syslog.<br></div><div>If this parameter is missing, the implicit log level is &#39;L_ERR&#39;.</div></div><div>===========</div><div>
<br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 13, 2014 at 8:41 AM, Liviu Chircu <span dir="ltr">&lt;<a href="mailto:liviu@opensips.org" target="_blank">liviu@opensips.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div><tt>Hello Oleksandr,<br>
        <br>
        By default, OpenSIPS should start with &quot;debug = 2&quot;. So unless
        you&#39;ve explicitly set a lower value within your script, all
        three messages should be logged.<br>
        <br>
        To troubleshoot this, when doing this test, could you also run a
        &quot;opensipsctl fifo debug&quot; command and paste the output here?<br>
        (make sure to load the mi_fifo module if it&#39;s not already there)<br>
        <br>
        Best regards,<br>
      </tt><div class="">
      <pre cols="72">Liviu Chircu
OpenSIPS Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre></div><div><div class="h5">
      On 08/13/2014 12:48 AM, Oleksandr Kunytsia wrote:<br>
    </div></div></div><div><div class="h5">
    <blockquote type="cite">
      <div dir="ltr">Hello Liviu,
        <div><br>
        </div>
        <div>I&#39;ve got local developer to test changes, so I can test now
          your suggestions:</div>
        <div><br>
        </div>
        <div>I started with such change:</div>
        <div><br>
        </div>
        <div>---------------------------</div>
        <div><br>
        </div>
        <div>startup_route {</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; #xlog(&quot;using localhost for routing&quot;);</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; xlog(&quot;L_INFO&quot;,&quot; L-INFO using localhost for
          routing&quot;);</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; xlog(&quot;L_NOTICE&quot;,&quot; L_NOTICE using localhost for
          routing&quot;);</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; xlog(&quot; no LEVEL using localhost for routing&quot;);</div>
        <div>}&nbsp;</div>
        <div><br>
        </div>
        <div>---------------------------<br>
        </div>
        <div><br>
        </div>
        <div>After I restarted opensips I got only one line in logs:</div>
        <div><br>
        </div>
        <div>
          <div>==&gt; /var/log/sips.log &lt;==</div>
          <div>local2.err&lt;147&gt;: Aug 12 14:44:05 sip1
            /usr/sbin/opensips[28615]: &nbsp;no LEVEL using localhost for
            routing</div>
        </div>
        <div><br>
        </div>
        <div>--------</div>
        <div><br>
        </div>
        <div>What is the reason of that?</div>
        <div><br>
        </div>
        <div>
          <div># /usr/sbin/opensips -V<br>
          </div>
          <div>version: opensips 1.7.1-tls (x86_64/linux)</div>
          <div>flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS,
            DISABLE_NAGLE, USE_MCAST, SHM_MEM, SHM_MMAP, PKG_MALLOC,
            F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT</div>
          <div>ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144,
            MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535</div>
          <div>poll method support: poll, epoll_lt, epoll_et, sigio_rt,
            select.</div>
          <div>svnrevision: unknown</div>
          <div>
            @(#) $Id: main.c 8537 2011-11-08 17:02:11Z bogdan_iancu $</div>
          <div>main.c compiled on 22:15:48 Nov 23 2011 with gcc 4.1.2</div>
          <div><br>
          </div>
        </div>
        <div>/Oleksandr</div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">
          On Thu, Aug 7, 2014 at 2:25 PM, Liviu Chircu <span dir="ltr">&lt;<a href="mailto:liviu@opensips.org" target="_blank">liviu@opensips.org</a>&gt;</span> wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF">
              <div><tt>I understand what&#39;s happening now. The thing is,
                  if you use xlog() with only 1 parameter in your
                  script, that message will simply go to syslog&#39;s
                  LOG_ERR (it should be visible!).<br>
                  <br>
                  You can control the logging level within your script
                  with xlog(&quot;L_NOTICE&quot;, &quot;.....&quot;) or xlog(&quot;L_DBG&quot;, &quot;...&quot;)
                  for example.<br>
                  <br>
                  Best regards,<br>
                </tt>
                <div>
                  <pre cols="72">Liviu Chircu
OpenSIPS Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
                </div>
                <div>
                  <div> On 08/06/2014 08:29 PM, Oleksandr
                    Kunytsia wrote:<br>
                  </div>
                </div>
              </div>
              <div>
                <div>
                  <blockquote type="cite">
                    <div dir="ltr">on my config debug set to 0:
                      <div>----</div>
                      <div>
                        <div><br>
                        </div>
                        <div>#</div>
                        <div># GLOBALS</div>
                        <div>#</div>
                        <div>debug=0</div>
                        <div>log_facility=LOG_LOCAL2</div>
                        <div>log_stderror=no</div>
                      </div>
                      <div>------</div>
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                      <div>I also configured rsyslog for saving LOCAL2
                        to file with specific template:</div>
                      <div>----</div>
                      <div>
                        <div>$template precise,&quot;%pri-text%:
                          %timegenerated% %HOSTNAME% %syslogtag%%msg%\n&quot;
                          &nbsp;</div>
                        <div>local2.* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                          -/var/log/sips.log;precise &nbsp;</div>
                        <div>----<br>
                        </div>
                      </div>
                      <div><br>
                      </div>
                      <div>extract from &nbsp;/var/log/sips.log:<br>
                      </div>
                      <div>
                        <div><br>
                        </div>
                        <div>local2.err&lt;147&gt;: Aug &nbsp;6 17:18:52
                          r-sip opensips[5588]: new-int
                          INVITE[PhoneNUM,PhoneNUM57]: SIP 404 after
                          19161ms from IP.ADD.RE.SS</div>
                        <div>local2.err&lt;147&gt;: Aug &nbsp;6 17:18:52
                          r-sip opensips[5612]: r-lt1
                          INVITE[+1PhoneNUM,PhoneNUM1]: SIP 180 after
                          25905ms from IP.ADD.RE.SS</div>
                        <div>local2.err&lt;147&gt;: Aug &nbsp;6 17:18:52
                          r-sip opensips[5592]: r-lt1
                          INVITE[+1PhoneNUM,PhoneNUM5]: relayed
                          IP.ADD.RE.SS outbound to IP.ADD.RE.SS</div>
                        <div>local2.err&lt;147&gt;: Aug &nbsp;6 17:18:52
                          r-sip opensips[5600]: r-in1
                          INVITE[+1PhoneNUM,PhoneNUM7]: relayed
                          IP.ADD.RE.SS outbound to IP.ADD.RE.SS</div>
                        <div>local2.err&lt;147&gt;: Aug &nbsp;6 17:18:52
                          r-sip opensips[5588]: new-int
                          INVITE[PhoneNUM7,PhoneNUM]: relayed
                          IP.ADD.RE.SS outbound to IP.ADD.RE.SS</div>
                        <div>local2.err&lt;147&gt;: Aug &nbsp;6 17:18:52
                          r-sip opensips[5560]: r-in1
                          INVITE[+PhoneNUM,PhoneNUM437]: SIP 100 after
                          3ms from IP.ADD.RE.SS</div>
                        <div>local2.err&lt;147&gt;: Aug &nbsp;6 17:18:52
                          r-sip opensips[5650]: r-lt1
                          INVITE[800PhoneNUM,PhoneNUM248]: relayed
                          IP.ADD.RE.SS outbound to IP.ADD.RE.SS</div>
                        <div>local2.err&lt;147&gt;: Aug &nbsp;6 17:18:52
                          r-sip opensips[5622]: r-lt1
                          INVITE[+PhoneNUM,PhoneNUM015]: SIP 100 after
                          9ms from IP.ADD.RE.SS</div>
                        <div>local2.err&lt;147&gt;: Aug &nbsp;6 17:18:52
                          r-sip opensips[5624]: Broadvox
                          BYE[PhoneNUM,PhoneNUM00] existing dialog</div>
                        <div>local2.err&lt;147&gt;: Aug &nbsp;6 17:18:52
                          r-sip opensips[5604]: r-in1
                          INVITE[80PhoneNUM,PhoneNUM213]: SIP 183 after
                          7270ms from IP.ADD.RE.SS</div>
                      </div>
                    </div>
                    <div class="gmail_extra"><br>
                      <br>
                      <div class="gmail_quote">On Wed, Aug 6, 2014 at
                        11:17 AM, Muhammad Shahzad <span dir="ltr">&lt;<a href="mailto:shaheryarkh@gmail.com" target="_blank">shaheryarkh@gmail.com</a>&gt;</span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                          <div dir="ltr">
                            <div>
                              <div>
                                <div>You can set opensips log level
                                  using &quot;debug&quot; parameter.<br>
                                  <br>
                                  <a href="http://www.opensips.org/Documentation/Script-CoreParameters-1-11#toc35" target="_blank">http://www.opensips.org/Documentation/Script-CoreParameters-1-11#toc35</a><br>
                                  <br>
                                </div>
                                Also make sure your syslog service is
                                configured to send local2.* logs to the
                                log file(s) where you want to see them.
                                i.e. to see all opensips logs file named
                                opensips.log set /etc/rsyslog.conf to
                                have entry like this,<br>
                                <br>
                              </div>
                              local2.*&nbsp; /var/log/opensips.log<br>
                              <br>
                            </div>
                            <div>Then restart the service.<br>
                            </div>
                            <div><br>
                            </div>
                            Hope this helps.<br>
                            <div>
                              <div>
                                <div><br>
                                </div>
                                <div>Thank you.<br>
                                  <br>
                                  <br>
                                </div>
                              </div>
                            </div>
                          </div>
                          <div class="gmail_extra"> <br>
                            <br>
                            <div class="gmail_quote">
                              <div>
                                <div>On Wed, Aug 6, 2014 at 10:49 AM,
                                  Oleksandr Kunytsia <span dir="ltr">&lt;<a href="mailto:okunia@gmail.com" target="_blank">okunia@gmail.com</a>&gt;</span>
                                  wrote:<br>
                                </div>
                              </div>
                              <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                                <div>
                                  <div>
                                    <div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hello,</span>
                                      <div style="font-family:arial,sans-serif;font-size:13px"><br>
                                      </div>
                                      <div style="font-family:arial,sans-serif;font-size:13px">Logging

                                        of my opensips looks like the
                                        following:</div>
                                      <div style="font-family:arial,sans-serif;font-size:13px">
                                        <div><br>
                                        </div>
                                        <div>----cut----&nbsp;</div>
                                        <div>log_facility=LOG_LOCAL2</div>
                                        <div>log_stderror=no</div>
                                      </div>
                                      <div style="font-family:arial,sans-serif;font-size:13px">----cut----<br>
                                      </div>
                                      <div style="font-family:arial,sans-serif;font-size:13px"><br>
                                      </div>
                                      <div style="font-family:arial,sans-serif;font-size:13px">Opensips

                                        sends logging information as
                                        LOCAL2.error messages,</div>
                                      <div style="font-family:arial,sans-serif;font-size:13px">
                                        <br>
                                      </div>
                                      <div style="font-family:arial,sans-serif;font-size:13px">How

                                        to configure to send messages
                                        with another log_level? e.g.&nbsp;<a href="http://local2.info/" target="_blank">local2.info</a>?</div>
                                      <div style="font-family:arial,sans-serif;font-size:13px">
                                      </div>
                                    </div>
                                    <br>
                                  </div>
                                </div>
                                <div>_______________________________________________<br>
                                  Users mailing list<br>
                                  <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
                                  <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
                                  <br>
                                </div>
                              </blockquote>
                            </div>
                            <br>
                          </div>
                          <br>
_______________________________________________<br>
                          Users mailing list<br>
                          <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
                          <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
                          <br>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                    <pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            Users mailing list<br>
            <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
            <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>