<div dir="auto">/run/systemd/journal/syslog exists and I am sure that ForwardToSyslog=yes is set on the default namespace.</div><div dir="auto"><br></div><div dir="auto">I’d like to setup an additional socket at /run/systemd/journal.my-namespace/syslog to forward logs to syslog from my own namespace. Can you point me to the documentation for how I should do this?</div><div dir="auto"><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 28, 2022 at 2:32 AM Mantas Mikulėnas <<a href="mailto:grawity@gmail.com">grawity@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr"><div>The forwarding itself is namespaced. ForwardToSyslog relies on the syslogd daemon setting up a receiving socket at /run/systemd/journal/syslog through which journald will send the messages – but for namespaced journald, the runtime directory is different (the point of it being namespaced) so the syslogd needs to set up an additional socket at /run/systemd/journal.my-namespace/syslog as well.<br></div><div><br></div><div>(Though are you sure the system was using ForwardToSyslog, and not some other method? The default configuration of both rsyslog and syslog-ng no longer uses this forwarding style, instead the syslogd directly imports messages from .journal files – which again needs the syslogd to be configured to read from the namespaced path in addition to the default path.)<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 27, 2022 at 11:01 PM Aaron Enberg <<a href="mailto:pastaaroni@gmail.com" target="_blank">pastaaroni@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr">Hi maintainers,<div><br></div><div>I am trying to get syslog forwarding working with a journal namespace I created for my application.</div><div><pre style="padding-top:8px;margin-top:0px;border-top-width:0px;border-top-style:none;white-space:pre-wrap;font-family:monospace;color:rgb(0,0,0)">My system is on Debian 11, systemd 247 (247.3-7+deb11u1)</pre><pre style="padding-top:8px;margin-top:0px;border-top-width:0px;border-top-style:none;white-space:pre-wrap;font-family:monospace;color:rgb(0,0,0)">Originally, my service used the default namespace and forwarding to syslog was working. After creating a journal namespace and assigning my service to it with
LogNamespace=my-namespace now the logs from my application do not get
forwarded to syslog.
I have made sure /etc/systemd/journald@my-namespace.conf exists and contains the
setting ForwardToSyslog=yes. I actually just copied the default config at
/etc/systemd/journal.conf which has forwarding enabled by default. I can see the
logs in the journal with journalctl --namespace my-namespace.</pre><pre style="padding-top:8px;margin-top:0px;border-top-width:0px;border-top-style:none;white-space:pre-wrap;font-family:monospace;color:rgb(0,0,0)">I haven't seen any bugs reported on this so I must be missing something.</pre><pre style="padding-top:8px;margin-top:0px;border-top-width:0px;border-top-style:none;white-space:pre-wrap;font-family:monospace;color:rgb(0,0,0)">Regards,</pre><pre style="padding-top:8px;margin-top:0px;border-top-width:0px;border-top-style:none;white-space:pre-wrap;font-family:monospace;color:rgb(0,0,0)">Aaron</pre></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr">Mantas Mikulėnas</div></div>
</blockquote></div></div>