RubyFlow The Ruby and Rails community linklog

Ruby logs and puts not shown in docker container logs

Given you are using Ruby 2.5.1 Docker image in Rails project, you may notice that no logs are beeing output to docker stdout (or docker compose stdout) output even when you configure your logger to be logger = Logger.new(STDOUT).

You need to configure your logger to point to Logger.new('/proc/1/fd/1').warn('hi')

More in article How to output Ruby logs and puts in docker container logs

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in