<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>the log_custom does not implement any syslog-kind-of-protocol, it
      simply sends out the plain log message to a remote target, it does
      not rely on LOG_LOCAL0 at all.</p>
    <p>During startup, till the config is parsed and modules
      initialized, various logs can go to the local system, not being
      handled by log_custom.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 04.07.22 04:39, hanxiaofang wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:2022070410395298264021@139.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <style>body { line-height: 1.5; }body { font-size: 14px; font-family: ??; color: rgb(0, 0, 0); line-height: 1.5; }</style>
      <div><span></span>
        <div style="font-family: "Microsoft YaHei UI",
          Tahoma;"><span style="background-color: transparent;">Hello
            Kamailio community</span></div>
        <div style="font-family: "Microsoft YaHei UI",
          Tahoma;"><br>
        </div>
        <div style="font-family: "Microsoft YaHei UI",
          Tahoma;">kamailio v5.5.4</div>
        <div style="font-family: "Microsoft YaHei UI",
          Tahoma;">debian10</div>
      </div>
      <div><br>
      </div>
      <div>log_facility is not always 'LOCAL0' when loadmodule
        log_custom.so</div>
      <div><br>
      </div>
      <div>cat /etc/kamailio/kamailio.cfg</div>
      <div><br>
      </div>
      <div>```</div>
      <div>
        <div>debug=3</div>
        <div>log_stderror=no</div>
        <div>log_facility=LOG_LOCAL0</div>
        <div>children=1</div>
        <div>listen=<a class="moz-txt-link-freetext" href="udp:0.0.0.0:5060">udp:0.0.0.0:5060</a></div>
        <div><br>
        </div>
        <div>log_engine_type="udp"</div>
        <div><span style="background-color: transparent;">log_engine_data="127.0.0.1:514"</span></div>
        <div><br>
        </div>
        <div>loadmodule "pv.so"</div>
        <div>alias="test.com"</div>
        <div><br>
        </div>
        <div>loadmodule "sl.so"</div>
        <div>loadmodule "corex.so"</div>
        <div>loadmodule "kex.so"</div>
        <div>loadmodule "log_custom.so"</div>
        <div><br>
        </div>
        <div>request_route {</div>
        <div>        if (uri != myself) {</div>
        <div>                sl_send_reply("403", "Not relaying");</div>
        <div>                exit;</div>
        <div>        }</div>
        <div>        sl_send_reply("200", "OK");</div>
        <div>        exit;</div>
        <div>}</div>
      </div>
      <div>```</div>
      <div><br>
      </div>
      <div><span style="background-color: transparent;">cat
          /etc/rsyslog.conf</span></div>
      <div><br>
      </div>
      <div>```</div>
      <div>
        <div># /etc/rsyslog.conf configuration file for rsyslog</div>
        <div>#</div>
        <div># For more information install rsyslog-doc and see</div>
        <div># /usr/share/doc/rsyslog-doc/html/configuration/index.html</div>
        <div><br>
        </div>
        <div>#################</div>
        <div>#### MODULES ####</div>
        <div>#################</div>
        <div><br>
        </div>
        <div>module(load="imuxsock") # provides support for local system
          logging</div>
        <div>module(load="imklog")   # provides kernel logging support</div>
        <div>#module(load="immark")  # provides --MARK-- message
          capability</div>
        <div><br>
        </div>
        <div># provides UDP syslog reception</div>
        <div>module(load="imudp")</div>
        <div>input(type="imudp" port="514")</div>
        <div><br>
        </div>
        <div># provides TCP syslog reception</div>
        <div>module(load="imtcp")</div>
        <div>input(type="imtcp" port="514")</div>
        <div><br>
        </div>
        <div>###########################</div>
        <div>#### GLOBAL DIRECTIVES ####</div>
        <div>###########################</div>
        <div><br>
        </div>
        <div>#</div>
        <div># Use traditional timestamp format.</div>
        <div># To enable high precision timestamps, comment out the
          following line.</div>
        <div>#</div>
        <div>#$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat</div>
        <div>$ActionFileDefaultTemplate RSYSLOG_DebugFormat</div>
        <div><br>
        </div>
        <div>#</div>
        <div># Set the default permissions for all log files.</div>
        <div>#</div>
        <div>$FileOwner root</div>
        <div>$FileGroup adm</div>
        <div>$FileCreateMode 0640</div>
        <div>$DirCreateMode 0755</div>
        <div>$Umask 0022</div>
        <div><br>
        </div>
        <div>#</div>
        <div># Where to place spool and state files</div>
        <div>#</div>
        <div>$WorkDirectory /var/spool/rsyslog</div>
        <div><br>
        </div>
        <div>#</div>
        <div># Include all config files in /etc/rsyslog.d/</div>
        <div>#</div>
        <div>$IncludeConfig /etc/rsyslog.d/*.conf</div>
        <div><br>
        </div>
        <div>###############</div>
        <div>#### RULES ####</div>
        <div>###############</div>
        <div><br>
        </div>
        <div>#</div>
        <div># First some standard log files.  Log by facility.</div>
        <div>#</div>
        <div>auth,authpriv.*                 /var/log/auth.log</div>
        <div>*.*;auth,authpriv.none          -/var/log/syslog</div>
        <div>#cron.*                         /var/log/cron.log</div>
        <div>daemon.*                        -/var/log/daemon.log</div>
        <div>kern.*                          -/var/log/kern.log</div>
        <div>lpr.*                           -/var/log/lpr.log</div>
        <div>mail.*                          -/var/log/mail.log</div>
        <div>user.*                          -/var/log/user.log</div>
        <div><br>
        </div>
        <div>#</div>
        <div># Logging for the mail system.  Split it up so that</div>
        <div># it is easy to write scripts to parse these files.</div>
        <div>#</div>
        <div>mail.info                       -/var/log/mail.info</div>
        <div>mail.warn                       -/var/log/mail.warn</div>
        <div>mail.err                        /var/log/mail.err</div>
        <div><br>
        </div>
        <div>#</div>
        <div># Some "catch-all" log files.</div>
        <div>#</div>
        <div>*.=debug;\</div>
        <div>        auth,authpriv.none;\</div>
        <div>        news.none;mail.none     -/var/log/debug</div>
        <div>*.=info;*.=notice;*.=warn;\</div>
        <div>        auth,authpriv.none;\</div>
        <div>        cron,daemon.none;\</div>
        <div>        mail,news.none          -/var/log/messages</div>
        <div><br>
        </div>
        <div>#</div>
        <div># Emergencies are sent to everybody logged in.</div>
        <div>#</div>
        <div>*.emerg                         :omusrmsg:*</div>
      </div>
      <div><span style="background-color: transparent;">```</span></div>
      <div><br>
      </div>
      <div><span style="background-color: transparent;">cat
          /var/log/messages</span></div>
      <div><br>
      </div>
      <div>```</div>
      <div>
        <div><span style="background-color: transparent;">Debug line
            with all properties:</span></div>
        <div>FROMHOST: 'kam', fromhost-ip: '127.0.0.1', HOSTNAME: 'kam',
          PRI: 134,</div>
        <div>syslogtag 'kamailio:', programname: 'kamailio', APP-NAME:
          'kamailio', PROCID: '-', MSGID: '-',</div>
        <div>TIMESTAMP: 'Jul  4 10:25:07', STRUCTURED-DATA: '-',</div>
        <div>msg: ' INFO: <core> [core/sctp_core.c:74]:
          sctp_core_check_support(): SCTP API not enabled - if you want
          to use it, load sctp module'</div>
        <div>escaped msg: ' INFO: <core> [core/sctp_core.c:74]:
          sctp_core_check_support(): SCTP API not enabled - if you want
          to use it, load sctp module'</div>
        <div>inputname: imuxsock rawmsg: '<134>Jul  4 10:25:07
          kamailio: INFO: <core> [core/sctp_core.c:74]:
          sctp_core_check_support(): SCTP API not enabled - if you want
          to use it, load sctp module'</div>
        <div>$!:</div>
        <div>$.:</div>
        <div>$/:</div>
        <div><br>
        </div>
      </div>
    </blockquote>
    [..]
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
</pre>
  </body>
</html>