Where do I find logs for snapd?

Where does snapd store its logs?

I keep getting snaps stop working and come up as broken in snap info and I’m guessing I probably need to find some logs to find out why (I’ll open a separate topic if I can find some reason in the logs)?

Apparently zgrep snapd $(/bin/ls -r /var/log/syslog*) | grep -v audit can get you something, I think I’m too late to work out anything of use from this though, will try and do something next time…

That’s pretty strange. Would be glad to hear more details.

You can find logs with:

$ journalctl -u snapd

Hmm, using --since "2017-09-26" I can’t see anything apart from what’s logged since last boot (I think).

zgrep snapd $(/bin/ls -r /var/log/syslog*) | grep -v audit does get me more and does cover the date that I ran into the bug so I’ll post that log in a separate thread?

This is the default behavior these days. If you want logs to persist across reboots, you need to create the directory /var/log/journal, and then restart journald.

Is syslog useful at all or do I need that journalctl log? I guess there’s no point posting a topic unless I have useful stuff!

Hard to tell if it’s useful or not without seeing it. The logs above don’t show anything relevant.

Are you or something in your system forcefully removing snap content out of /snap? That’d be one reason why snapd would make snaps as broken. If you do snap info on the broken snap, there should also be a reason hinting why it was considered broken IIRC.

on classic systems syslog and journald are both constantly running, all logger output is logged in parallel so syslog should always have the same content (but not limited to one boot) but misses the journald filter features …