I use balena-sdk to subscribe logs. (balena.logs.subscribe). Is there a way to know the logs from which container?

For now, I get this. I have several containers running on the same device. There is no way to know this log message is from which container.

{
  createdAt: 1708120307297,
  timestamp: 1708120306804,
  isSystem: false,
  isStdErr: false,
  serviceId: 2243982,
  message: 'Control connection had an error and is now closed\r'
}

I fount it out. I can know the logs from which container based on serviceId.

1 Like

Hello @kaman first of all welcome to the balena community!

Thanks for sharing that you found the solution for your issue!

Let us know if we can help you more!