I am looking for a possibility to set the systemd service setting LogNamespace= (details see https://man.archlinux.org/man/systemd.exec.5.en) for a service created by snap via snap.yaml (snapcraft.yaml).
one thing to note is that all snaps typically write log entries prefixed with <snapname>.<servicename>, you might be able to filter based on this …
If you really need namespaced logging you should first of all file a bug against snapd so that a LogNamespace setting gets added to the daemon: handling eventually …
regarding the command-chain, a command-chain script needs to be created and installed somewhere in your snap (you can use a separate part for this if needed) and then called from the command-chain: entry in the snapcraft.yaml…
while you can not modify the LogNamespace entry with this, you should be able to use logger like: