Reading systemd logs from inside the snap

Hi all,
Im trying to read in to my snap all system logs, im trying to do something like this:

args := "journalctl --utc -o json  | gzip --best > systemdLogs.gz"
cmd := exec.Command("bash", "-c", args)

But it seems that the snap dont have permissions to run journalctl

How do i give permissions to the snap in order to read ALL systemd logs?

Thanks in advance for your help!!
Regards
Ernesto

defining and connecting the log-observe plug should help here …

1 Like