tmds / Tmds.Systemd

.NET Core library for interacting with systemd
Other
128 stars 17 forks source link

Journal.SyslogIdentifier should default to the application name #38

Closed tmds closed 5 years ago

tmds commented 5 years ago

Currently this is hard-coded to "dotnet".

It would be better to match the systemd.exec behavior:

If not set, defaults to the process name of the executed process.

ygoe commented 4 years ago

Somehow this doesn't do what I'd think it should do. All my messages have "null" as their identifier. When I set the name in the config options manually, it will be used.

ygoe commented 4 years ago

Hm, seems to be a problem of my log viewer. It's not "null" but unset. journalctl shows "dotnet" but it's not the same as for console output. Those have the name of the starting script, or whatever I set as SyslogIdentifier in the service unit file. But then again, it seems expected that this identifier only applies to console output, not native journal messages.

So I guess I'll have to set this field to a meaningful value in my application. I'll probably fetch it from the app's configuration.