Logging issues with multiple processes

I’m running a multi-process rails app with a sidekiq worker via the following config:

app = "bundle exec puma -C config/puma.rb"
sidekiq = "bundle exec sidekiq -C config/sidekiq.yml"

However, I’m seeing both processes’ logs in the same app logstream; the sidekiq worker logs are not in a sidekiq log stream when running fly logs.

It seems like the easy answer here is to not do multi-process and just run sidekiq as a separate fly app?

Yeah this is one of the grosser things about multiple processes.

I think running separate apps is probably best for now, even though I hate it.

If you’re feeling ambitious, you can probably configure sidekiq/rails to prepend something to each log line.

1 Like

I don’t suppose there’s an easy way to tie the second container/app to the image of the “main” app? Trying to avoid building the same image twice when the only functional difference is the command.

I guess I could use fly image show after the first one has deployed to grab the image tag and run fly deploy -i registry.fly.io/APP_NAME:IMAGE_TAG

1 Like

That’s exactly right. You can even build with a specific tag: fly deploy --label <git-sha>. Then you can fly deploy registry.fly.io/<app>:<git-sha> -a <other-app>