<div dir="ltr">Thanks Kris, "<span style="color:rgb(0,0,0);font-family:Calibri;font-size:14.6667px">StandardOutput=null" did the trick.</span><div><br></div><div>Besides, this post (<a href="http://www.kibinlabs.com/systemd-logging-tricks/">http://www.kibinlabs.com/systemd-logging-tricks/</a>) treats nova-compute as a "bad daemon" :=(<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 9, 2016 at 7:05 PM, Kris G. Lindgren <span dir="ltr"><<a href="mailto:klindgren@godaddy.com" target="_blank">klindgren@godaddy.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Systemd logs all python output by default, if you have rsyslog to pull from the systemd as well you can get double logging. I think you need to execute under systemd with: StandardOutput=null
in the unit file under the [service] heading. Atleast that’s what we do. <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Disclaimer: we don’t run rsyslog but use file output (and we are running CentOS7). Our problem was that we got debug level messages to /var/log/messages and the correct loglevel in /var/log/nova/nova-compute.log
Telling system to not ouput logs prevented that from happening.<u></u><u></u></span></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:Calibri;color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:Calibri;color:black">______________________________<wbr>______________________________<wbr>_______<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:Calibri;color:black">Kris Lindgren<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:Calibri;color:black">Senior Linux Systems Engineer<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:Calibri;color:black">GoDaddy</span><span style="font-size:11.0pt;font-family:Calibri"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-family:Calibri;color:black">From: </span>
</b><span style="font-family:Calibri;color:black">Gustavo Randich <<a href="mailto:gustavo.randich@gmail.com" target="_blank">gustavo.randich@gmail.com</a>><br>
<b>Date: </b>Tuesday, August 9, 2016 at 3:52 PM<br>
<b>To: </b>"<a href="mailto:openstack-operators@lists.openstack.org" target="_blank">openstack-operators@lists.<wbr>openstack.org</a>" <<a href="mailto:openstack-operators@lists.openstack.org" target="_blank">openstack-operators@lists.<wbr>openstack.org</a>><br>
<b>Subject: </b>[Openstack-operators] systemd and duplicate logs -- /var/log/syslog and /var/log/nova/nova-compute.log<u></u><u></u></span></p>
</div><div><div class="h5">
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Hi guys,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">We want to be able to forward nova-compute's log to a central rsyslog but at the same time mantain the local "/var/log/nova/nova-compute.<wbr>log". In Icehouse we achieved this with the following configuration in "/etc/rsyslog.d/60-nova.conf":<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<blockquote style="margin-left:30.0pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal">*.*;local0.none,auth,authpriv.<wbr>none -/var/log/syslog<u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">local0.* @@<a href="http://10.161.0.1:1024" target="_blank">10.161.0.1:1024</a><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">local0.* /var/log/nova/nova-compute.log<u></u><u></u></p>
</div>
</div>
</blockquote>
<div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<div>
<p class="MsoNormal">We also had to comment this line in "/etc/rsyslog.d/50-default.<wbr>conf" (reference: <a href="https://www.osso.nl/blog/rsyslog-cron-deleting-rules" target="_blank">https://www.osso.<wbr>nl/blog/rsyslog-cron-deleting-<wbr>rules</a>)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<blockquote style="margin-left:30.0pt;margin-right:0in">
<div>
<p class="MsoNormal">*.*;auth,authpriv.none -/var/log/syslog<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">Now, in Mitaka / Ubuntu 16 / systemd, with this same configuration, we are getting duplicate logs: every line goes to /var/log/syslog and /var/log/nova/nova-compute.log
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">We want to only log in nova-compute.log<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">Maybe this is because systemd is forwarding everything to rsyslog? By default, /etc/systemd/journald.conf has "ForwardToSyslog=yes"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<div>
<p class="MsoNormal">thanks!<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Gustavo<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div>
</div></div></div>
</div>
</blockquote></div><br></div>