<p>Got a bit of time to test this with latest master and it seems to work with following basic config:</p>
<pre><code>#!KAMAILIO

####### Global Parameters #########

### LOG Levels: 3=DBG, 2=INFO, 1=NOTICE, 0=WARN, -1=ERR
debug=2
log_stderror=no

memdbg=5
memlog=5

log_facility=LOG_LOCAL0
log_prefix="{$mt $hdr(CSeq) $ci} "

/* number of SIP routing processes */
children=2

log_engine_type="systemd"

####### Modules Section ########

/* set paths to location of modules */
# mpath="/usr/local/lib/kamailio/modules/"

loadmodule "log_systemd.so"
loadmodule "jsonrpcs.so"
loadmodule "kex.so"
loadmodule "corex.so"
loadmodule "tm.so"
loadmodule "tmx.so"
loadmodule "sl.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "maxfwd.so"
loadmodule "textops.so"
loadmodule "siputils.so"
loadmodule "xlog.so"
loadmodule "sanity.so"
loadmodule "ctl.so"
loadmodule "cfg_rpc.so"
loadmodule "counters.so"



####### Routing Logic ########


/* Main SIP request routing logic
 * - processing of any incoming SIP request starts with this route
 * - note: this is the same as route { ... } */
request_route {
        xlog("===== test xlog message - R-URI is $ru\n");
        sd_journal_print("LOG_ERR", "+++++ test sysd message - R-URI is $ru\n");
        sl_send_reply("200", "ok");
        exit;
}
</code></pre>
<p>I sent test packets with sipsak, and in journalctl I see:</p>
<pre><code>root@portugal ~ # journalctl -f
-- Logs begin at Tue 2018-09-11 19:12:04 CEST. --
Sep 17 12:14:06 portugal kamailio[4540]: INFO: <core> [core/udp_server.c:205]: probe_max_receive_buffer(): SO_RCVBUF is finally 425984
Sep 17 12:14:06 portugal kamailio[4540]: INFO: <core> [core/udp_server.c:153]: probe_max_receive_buffer(): SO_RCVBUF is initially 212992
Sep 17 12:14:06 portugal kamailio[4540]: INFO: <core> [core/udp_server.c:205]: probe_max_receive_buffer(): SO_RCVBUF is finally 425984
Sep 17 12:14:06 portugal kamailio[4553]: INFO: jsonrpcs [jsonrpcs_sock.c:443]: jsonrpc_dgram_process(): a new child 0/4553
Sep 17 12:14:06 portugal kamailio[4554]: INFO: ctl [io_listener.c:214]: io_listen_loop(): io_listen_loop:  using epoll_lt io watch method (config)
Sep 17 12:14:48 portugal kamailio[4541]: ERROR: {1 1 OPTIONS 1446075015@127.0.1.1} <script>: ===== test xlog message - R-URI is sip:test@127.0.0.1
Sep 17 12:14:48 portugal kamailio[4541]: +++++ test sysd message - R-URI is sip:test@127.0.0.1
Sep 17 12:17:01 portugal CRON[4567]: pam_unix(cron:session): session opened for user root by (uid=0)
Sep 17 12:17:01 portugal CRON[4568]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 17 12:17:01 portugal CRON[4567]: pam_unix(cron:session): session closed for user roo
Sep 17 12:20:00 portugal kamailio[4542]: ERROR: {1 1 OPTIONS 306190950@127.0.1.1} <script>: ===== test xlog message - R-URI is sip:test@127.0.0.1
Sep 17 12:20:00 portugal kamailio[4542]: +++++ test sysd message - R-URI is sip:test@127.0.0.1
</code></pre>
<p>Kamailio was compiled and started from source tree with:</p>
<pre><code> ./src/kamailio -f ../etc/kamailio-logsystemd.cfg -L src/modules/ -a no
</code></pre>
<p>Given that the report was made for an old version, I am going to close this issue. Test with master or 5.1 and if you still have issues, then open a new item with relevant details for the newer versions. Try to use this basic config to see if behaves differently. I tested on Debian stable.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/799#issuecomment-421958839">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZcNu4n2HFOE3iTildq6W4Tu7f4usks5ub3jfgaJpZM4KHJxh">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZTJgSjz57LXWjRIN9z4iFP86Yys5ks5ub3jfgaJpZM4KHJxh.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@miconda in #799: Got a bit of time to test this with latest master and it seems to work with following basic config:\r\n\r\n```\r\n#!KAMAILIO\r\n\r\n####### Global Parameters #########\r\n\r\n### LOG Levels: 3=DBG, 2=INFO, 1=NOTICE, 0=WARN, -1=ERR\r\ndebug=2\r\nlog_stderror=no\r\n\r\nmemdbg=5\r\nmemlog=5\r\n\r\nlog_facility=LOG_LOCAL0\r\nlog_prefix=\"{$mt $hdr(CSeq) $ci} \"\r\n\r\n/* number of SIP routing processes */\r\nchildren=2\r\n\r\nlog_engine_type=\"systemd\"\r\n\r\n####### Modules Section ########\r\n\r\n/* set paths to location of modules */\r\n# mpath=\"/usr/local/lib/kamailio/modules/\"\r\n\r\nloadmodule \"log_systemd.so\"\r\nloadmodule \"jsonrpcs.so\"\r\nloadmodule \"kex.so\"\r\nloadmodule \"corex.so\"\r\nloadmodule \"tm.so\"\r\nloadmodule \"tmx.so\"\r\nloadmodule \"sl.so\"\r\nloadmodule \"rr.so\"\r\nloadmodule \"pv.so\"\r\nloadmodule \"maxfwd.so\"\r\nloadmodule \"textops.so\"\r\nloadmodule \"siputils.so\"\r\nloadmodule \"xlog.so\"\r\nloadmodule \"sanity.so\"\r\nloadmodule \"ctl.so\"\r\nloadmodule \"cfg_rpc.so\"\r\nloadmodule \"counters.so\"\r\n\r\n\r\n\r\n####### Routing Logic ########\r\n\r\n\r\n/* Main SIP request routing logic\r\n * - processing of any incoming SIP request starts with this route\r\n * - note: this is the same as route { ... } */\r\nrequest_route {\r\n\txlog(\"===== test xlog message - R-URI is $ru\\n\");\r\n\tsd_journal_print(\"LOG_ERR\", \"+++++ test sysd message - R-URI is $ru\\n\");\r\n\tsl_send_reply(\"200\", \"ok\");\r\n\texit;\r\n}\r\n```\r\n\r\nI sent test packets with sipsak, and in journalctl I see:\r\n\r\n```\r\nroot@portugal ~ # journalctl -f\r\n-- Logs begin at Tue 2018-09-11 19:12:04 CEST. --\r\nSep 17 12:14:06 portugal kamailio[4540]: INFO: \u003ccore\u003e [core/udp_server.c:205]: probe_max_receive_buffer(): SO_RCVBUF is finally 425984\r\nSep 17 12:14:06 portugal kamailio[4540]: INFO: \u003ccore\u003e [core/udp_server.c:153]: probe_max_receive_buffer(): SO_RCVBUF is initially 212992\r\nSep 17 12:14:06 portugal kamailio[4540]: INFO: \u003ccore\u003e [core/udp_server.c:205]: probe_max_receive_buffer(): SO_RCVBUF is finally 425984\r\nSep 17 12:14:06 portugal kamailio[4553]: INFO: jsonrpcs [jsonrpcs_sock.c:443]: jsonrpc_dgram_process(): a new child 0/4553\r\nSep 17 12:14:06 portugal kamailio[4554]: INFO: ctl [io_listener.c:214]: io_listen_loop(): io_listen_loop:  using epoll_lt io watch method (config)\r\nSep 17 12:14:48 portugal kamailio[4541]: ERROR: {1 1 OPTIONS 1446075015@127.0.1.1} \u003cscript\u003e: ===== test xlog message - R-URI is sip:test@127.0.0.1\r\nSep 17 12:14:48 portugal kamailio[4541]: +++++ test sysd message - R-URI is sip:test@127.0.0.1\r\nSep 17 12:17:01 portugal CRON[4567]: pam_unix(cron:session): session opened for user root by (uid=0)\r\nSep 17 12:17:01 portugal CRON[4568]: (root) CMD (   cd / \u0026\u0026 run-parts --report /etc/cron.hourly)\r\nSep 17 12:17:01 portugal CRON[4567]: pam_unix(cron:session): session closed for user roo\r\nSep 17 12:20:00 portugal kamailio[4542]: ERROR: {1 1 OPTIONS 306190950@127.0.1.1} \u003cscript\u003e: ===== test xlog message - R-URI is sip:test@127.0.0.1\r\nSep 17 12:20:00 portugal kamailio[4542]: +++++ test sysd message - R-URI is sip:test@127.0.0.1\r\n```\r\n\r\nKamailio was compiled and started from source tree with:\r\n\r\n```\r\n ./src/kamailio -f ../etc/kamailio-logsystemd.cfg -L src/modules/ -a no\r\n```\r\n\r\nGiven that the report was made for an old version, I am going to close this issue. Test with master or 5.1 and if you still have issues, then open a new item with relevant details for the newer versions. Try to use this basic config to see if behaves differently. I tested on Debian stable."}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/799#issuecomment-421958839"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/799#issuecomment-421958839",
"url": "https://github.com/kamailio/kamailio/issues/799#issuecomment-421958839",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [kamailio/kamailio] Unexpected log_systemd behavior when daemon is forked (#799)",
"sections": [
{
"text": "",
"activityTitle": "**Daniel-Constantin Mierla**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@miconda",
"facts": [

]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 799,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/kamailio/kamailio/issues/799#issuecomment-421958839"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 169647201\n}"
}
],
"themeColor": "26292E"
}
]</script>