Incus/IncusOS and OCI console logging

I’ve been slowly working through the process of using OCI images in Incus/OS (thanks to all involved in helping there!) and have come to the issue of logging.

Quite a few of my container images log to stdout/stderr (eg https://hub.docker.com/\_/nginx ), so i need to be able to query those logs over time.

incus console ... --show-log (as suggested in Obtaining container logs on IncusOS ) is ok for ad hoc queries but

  • once the logs are read, they aren’t repeated (its not like running tail on a file)
  • if there are too many logs nothing is displayed at all.

I’m developing with Incus+Debian but the hosting environment is IncusOS, so looking at the on disk files (as suggested in How to show logs from OCI container or where to find them? - #5 by cstby ) isn’t feasible once moving beyond the hacking around stage.

Will IncusOS store those instance console logs long term somewhere I can gather them or will I have to enable syslog ( Logging - IncusOS documentation ) so those console logs are streamed to a log sink?

Can Incus-on-Debian be configured to record those console logs via syslog/systemd to better help emulate the incusos hosting environment?

There has been a fix in 7.2 where the ringbuffer doesn’t get reseted, so you should be able to call --show-log multiple times.

But it is a ringbuffer so it’s output might not be determistic.

I’ve been thinking with incus-compose about the same problem you describe and I think we should add support for something like fluentd as log collector.

I’m on IncusOS 202606201302 so may not have picked up that fix yet, I’ll look at updating to at least solve that bit of the problem.

While investigating this issue (before posting) I found Configurable syslog targets · Issue #1420 · lxc/incus · GitHub which mentions Loki logging. For me it shares a problem with syslog - I’d need to deploy another service to ingest those logs (I will if thats the only option, of course!)

Something inside IncusOS that would have allowed the equivalent of tail /var/log/incus/container-*/console.log would have been handy if it existed.