<div dir="ltr">Hi Lennart,<div><br></div><div>I found a workaround. When looking at the source code for <span style="font-size:12.8000001907349px">sd_journal_print(), I saw that </span><span style="font-size:12.8000001907349px">SYSLOG_IDENTIFIER defaults to the string pointed to by </span>program_invocation_short_name (defined in errno.h)<span style="font-size:12.8000001907349px">. So I simply create a new string with the text that I want to assign to </span><span style="font-size:12.8000001907349px">SYSLOG_IDENTIFIER</span><span style="font-size:12.8000001907349px"> and I make </span>program_invocation_short_name point to it. </div><div><br></div><div>It may not be the prettiest fix, but it works for the daemons I'm instantiating.</div><div><br></div><div>Thanks,</div><div>Martin</div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><table border="0" width="280" bgcolor="white" style="margin-bottom:1.25em;border:none;font-family:'Helvetica Neue',Helvetica,Helvetica,Arial,sans-serif;font-size:16px;line-height:16px;width:280px;padding:10px;background-image:initial;background-repeat:initial"><tbody><tr><td style="padding:0px;direction:ltr;font-size:9px;color:rgb(0,0,0);line-height:1.125em;font-family:Arial,sans"><span style="color:rgb(0,114,188);font-size:12px;font-weight:bold">Martin Belanger</span><br>Sr. Software Engineer</td><td style="padding:0px;direction:ltr;font-size:9px;color:rgb(0,0,0);line-height:1.125em;font-family:Arial,sans"><img src="http://www.cyaninc.com/static/daylight/images/cyan_logo.png" height="26" width="68" alt="Cyan" style="max-width:100%;height:auto;display:inline-block;vertical-align:middle"></td></tr><tr style="background:none"><td colspan="2" style="padding:0px;direction:ltr;font-size:9px;color:rgb(0,0,0);line-height:1.125em;font-family:Arial,sans"><img src="http://www.cyaninc.com/static/daylight/images/sep.gif" style="max-width:100%;height:auto;display:inline-block;vertical-align:middle"></td></tr><tr><td style="padding:0px;direction:ltr;font-size:9px;color:rgb(0,0,0);line-height:15px;font-family:Arial,sans">1383 North McDowell Blvd.<br>Petaluma, CA 94954</td><td style="padding:0px;direction:ltr;font-size:9px;color:rgb(0,0,0);line-height:1.125em;font-family:Arial,sans"><table border="0" style="margin-bottom:1.25em;border:none;background-image:initial;background-repeat:initial"><tbody><tr><td style="padding:0px;direction:ltr;font-size:7px;line-height:1.125em;font-family:Arial,sans;font-weight:bold">M</td><td style="padding:0px;direction:ltr;font-size:9px;line-height:1.125em;font-family:Arial,sans"><a style="color:rgb(0,0,0);text-decoration:none;line-height:inherit">(707) 481-3392</a></td></tr><tr style="background:none"><td style="padding:0px;direction:ltr;font-size:7px;line-height:1.125em;font-family:Arial,sans;font-weight:bold">E</td><td style="padding:0px;direction:ltr;font-size:9px;line-height:1.125em;font-family:Arial,sans"><a href="mailto:martin.belanger@cyaninc.com" style="color:rgb(0,114,188);text-decoration:none;line-height:inherit" target="_blank">martin.belanger@cyaninc.com</a></td></tr></tbody></table></td></tr><tr style="background:none"><td style="padding:0px;direction:ltr;font-size:9px;color:rgb(0,0,0);line-height:1.125em;font-family:Arial,sans"><a href="http://www.cyaninc.com/" title="Cyan Inc" style="color:rgb(0,114,188);text-decoration:none;line-height:inherit" target="_blank">www.cyaninc.com</a></td><td style="padding:0px;direction:ltr;font-size:9px;color:rgb(0,0,0);line-height:1.125em;font-family:Arial,sans"><a href="http://www.facebook.com/CyanInc" title="Facebook" style="color:rgb(43,166,203);text-decoration:none;line-height:inherit" target="_blank"><img src="http://www.cyaninc.com/static/daylight/images/fb.gif" height="12" width="13" border="0" alt="Facebook" style="max-width:100%;height:auto;display:inline-block;vertical-align:middle;border:none"></a> <a href="http://www.linkedin.com/company/cyan-inc?trk=hb_tab_compy_id_2171992" title="LinkedIn" style="color:rgb(43,166,203);text-decoration:none;line-height:inherit" target="_blank"><img src="http://www.cyaninc.com/static/daylight/images/li.gif" height="12" width="14" border="0" alt="LinkedIn" style="max-width:100%;height:auto;display:inline-block;vertical-align:middle;border:none"></a> <a href="http://twitter.com/CyanNews" title="Twitter" style="color:rgb(43,166,203);text-decoration:none;line-height:inherit" target="_blank"><img src="http://www.cyaninc.com/static/daylight/images/tw.gif" height="12" width="13" border="0" alt="Twitter" style="max-width:100%;height:auto;display:inline-block;vertical-align:middle;border:none"></a></td></tr><tr><td colspan="2" style="padding:0px;direction:ltr;font-size:0.875em;line-height:1.125em"><img src="http://www.cyaninc.com/static/daylight/images/sep.gif" style="max-width:100%;height:auto;display:inline-block;vertical-align:middle"></td></tr></tbody></table></div></div></div>
<br><div class="gmail_quote">On Tue, Jun 9, 2015 at 3:16 AM, Lennart Poettering <span dir="ltr"><<a href="mailto:lennart@poettering.net" target="_blank">lennart@poettering.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, 02.06.15 20:31, Martin Belanger (<a href="mailto:martin.belanger@cyaninc.com">martin.belanger@cyaninc.com</a>) wrote:<br>
<br>
> I'm using systemd 219 (Ubuntu 15.04).<br>
><br>
> I have three instances of a daemon running. I use SyslogIdentifier to<br>
> give each of them a unique identifier (e.g. myproc-1, myproc-2,<br>
> myproc-3).  I also redirect stdout/stderr to the journal using<br>
> StandardOutput=journal and StandardError=journal.<br>
><br>
> I noticed that messages sent to the journal with printf (i.e. stdout)<br>
> get the proper SYSLOG_IDENTIFIER.  However, messages send to the<br>
> journal with sd_journal_print() get the default SYSLOG_IDENTIFIER<br>
> (i.e. the process name).  I also tried sd_journal_send() and get the<br>
> same result.<br>
><br>
> Any thoughts as to why this is happening?<br>
<br>
</div></div>SyslogIdentifier only really applies to stdout/stderr messages, not to<br>
native journal messages, which will not carry that id at all.<br>
<br>
The only reason the setting exists is because it's useful to set<br>
something there because stdout/stderr doesn't carry enough information<br>
for this, and because the same stdout/stderr stream can be shared<br>
among multiple processes it's difficult and misleading to<br>
automatically derive the identifier from them...<br>
<br>
Hence: I'd really prefer fi we didn't have that option at all, we<br>
justed added it, because it was difficult to do without...<br>
<span class="HOEnZb"><font color="#888888"><br>
Lennart<br>
<br>
--<br>
Lennart Poettering, Red Hat<br>
</font></span></blockquote></div><br></div>