{"id":229,"date":"2026-06-15T10:58:43","date_gmt":"2026-06-15T08:58:43","guid":{"rendered":"https:\/\/www.codenicer.com\/?p=229"},"modified":"2026-06-15T10:58:43","modified_gmt":"2026-06-15T08:58:43","slug":"syslog-message-routing-on-linux","status":"publish","type":"post","link":"https:\/\/www.codenicer.com\/?p=229","title":{"rendered":"Syslog message routing on Linux"},"content":{"rendered":"\n<p>Create new file (if needed) in <code>\/etc\/rsyslog.d<\/code> (file&#8217;s name should end in <code>.conf<\/code>). Make sure to add following line to it:<\/p>\n\n\n\n<p><code>if $programname == 'PROGRAM_NAME' then \/var\/log\/debug.log<\/code><\/p>\n\n\n\n<p>if you don&#8217;t want this message to go anywhere else, add <code><strong>\"&amp; stop\"<\/strong><\/code> in a separate line after it.<\/p>\n\n\n\n<p>If messages go to custom file, don&#8217;t forget to make sure that this file is rotated as needed (by creating entry in <code>\/etc\/logrotate.d<\/code>) &#8211; example:<\/p>\n\n\n\n<p><code>\/var\/log\/myprogram.log   # path to log file name<br>{<br>  daily<br>  rotate 14<br>  compress<br>  delaycompress<br>  missingok<br>  notifempty<br>  create 0640 syslog adm # appropriate permissions<br>  postrotate<br>    systemctl reload rsyslog >\/dev\/null 2>&amp;1 || true<br>  endscript<br>}<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Create new file (if needed) in \/etc\/rsyslog.d (file&#8217;s name should end in .conf). Make sure to add following line to it: if $programname == &#8216;PROGRAM_NAME&#8217; then \/var\/log\/debug.log if you don&#8217;t want this message to go anywhere else, add &#8220;&amp; stop&#8221; in a separate line after it. If messages go to custom file, don&#8217;t forget to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[25,146],"class_list":["post-229","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-linux","tag-syslog"],"_links":{"self":[{"href":"https:\/\/www.codenicer.com\/index.php?rest_route=\/wp\/v2\/posts\/229","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codenicer.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codenicer.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codenicer.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codenicer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=229"}],"version-history":[{"count":1,"href":"https:\/\/www.codenicer.com\/index.php?rest_route=\/wp\/v2\/posts\/229\/revisions"}],"predecessor-version":[{"id":230,"href":"https:\/\/www.codenicer.com\/index.php?rest_route=\/wp\/v2\/posts\/229\/revisions\/230"}],"wp:attachment":[{"href":"https:\/\/www.codenicer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codenicer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codenicer.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}