{"id":509,"date":"2006-05-11T01:44:50","date_gmt":"2006-05-11T06:44:50","guid":{"rendered":"http:\/\/blogs.law.harvard.edu\/hoanga\/2006\/05\/11\/getting-postfix-to-log-properly-in-gen"},"modified":"2006-05-11T01:44:50","modified_gmt":"2006-05-11T06:44:50","slug":"getting-postfix-to-log-properly-in-gentoo","status":"publish","type":"post","link":"https:\/\/archive.blogs.harvard.edu\/hoanga\/2006\/05\/11\/getting-postfix-to-log-properly-in-gentoo\/","title":{"rendered":"Getting postfix to log properly in Gentoo"},"content":{"rendered":"<p><a name='a625'><\/a><\/p>\n<p>\n I&#8217;ve been using Gentoo a bit lately and one thing that is nice is the portage system which tends to<br \/>\n configure your systems rather sanely but there always needs to be tweaks&#8230;\n <\/p>\n<p>\n If you install postfix and are using syslog-ng which is the default syslogging tool for Gentoo.<br \/>\n You&#8217;ll notice all of your postfix messages go into \/var\/log\/messages by default.  Note this sucks<br \/>\n since sending all syslog events to one big file is a bad idea when it comes to troubleshooting.<br \/>\n After googling around I dug up a perfect<br \/>\n <a href=\"http:\/\/www.irbs.net\/internet\/postfix\/0602\/0730.html\">thread<\/a><br \/>\n describing how to configure postfix log to something more sane like \/var\/log\/mail.log\n <\/p>\n<p>\n For you lazier folk here&#8217;s the punchline.  Put this in \/etc\/syslog-ng\/syslog-ng.conf<br \/>\n (Note you&#8217;ll need to actually do some editing rather than just blind cut &amp; paste):<br \/>\n <br \/>\n &#8212;&#8212;<\/p>\n<p> <em><br \/>\n source src &#123; unix-stream(&#8220;\/dev\/log&#8221;); internal(); pipe(&#8220;\/proc\/kmsg&#8221;); &#125;;<\/p>\n<p> destination mail &#123; file(&#8220;\/var\/log\/mail.log&#8221;); &#125;;<br \/>\n destination messages &#123; file(&#8220;\/var\/log\/messages&#8221;); &#125;;<\/p>\n<p> destination console_all &#123; file(&#8220;\/dev\/tty12&#8221;); &#125;;<\/p>\n<p> filter mail &#123; facility(mail); &#125;;<br \/>\n filter notmail &#123; not facility(mail); &#125;;<\/p>\n<p> log &#123; source(src); filter(mail); destination(mail); &#125;;<\/p>\n<p> log &#123; source(src); filter(notmail); destination(messages); &#125;;<\/p>\n<p> log &#123; source(src); destination(console_all); &#125;; <br \/>\n <\/em><br \/>\n <br \/>\n &#8212;&#8212;\n <\/p>\n<p>\n <a href=\"http:\/\/www.irbs.net\/internet\/postfix\/0602\/0730.html\">Read it yourself<\/a>\n <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been using Gentoo a bit lately and one thing that is nice is the portage system which tends to configure your systems rather sanely but there always needs to be tweaks&#8230; If you install postfix and are using syslog-ng which is the default syslogging tool for Gentoo. You&#8217;ll notice all of your postfix messages [&hellip;]<\/p>\n","protected":false},"author":704,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1212],"tags":[],"class_list":["post-509","post","type-post","status-publish","format-standard","hentry","category-tagme"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/archive.blogs.harvard.edu\/hoanga\/wp-json\/wp\/v2\/posts\/509","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/archive.blogs.harvard.edu\/hoanga\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/archive.blogs.harvard.edu\/hoanga\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/hoanga\/wp-json\/wp\/v2\/users\/704"}],"replies":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/hoanga\/wp-json\/wp\/v2\/comments?post=509"}],"version-history":[{"count":0,"href":"https:\/\/archive.blogs.harvard.edu\/hoanga\/wp-json\/wp\/v2\/posts\/509\/revisions"}],"wp:attachment":[{"href":"https:\/\/archive.blogs.harvard.edu\/hoanga\/wp-json\/wp\/v2\/media?parent=509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/hoanga\/wp-json\/wp\/v2\/categories?post=509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/hoanga\/wp-json\/wp\/v2\/tags?post=509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}