0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

DockerのRailsコンテナがログ(logger, puts)を表示しない

Posted at

はじめに

この記事は2022年2月にまとめていた「細かいつまずいたことをメモしておく(2月編)をそれぞれ投稿した内容になります
解決方法が最新でない可能性もありますのでご了承ください

問題

DockerコンテナでRails環境を構築したところlogger.debugputsを行っても標準出力が行われなかった

解決方法

puma.rbで標準出力がlog/puma.stdout.logにリダイレクトしていた

config/puma.rb
# stdout_redirect "#{app_root}/log/puma.stdout.log", "#{app_root}/log/puma.stderr.log", true
unless ENV.fetch("RAILS_ENV", "development") == "development"
  stdout_redirect "#{app_root}/log/puma.stdout.log", "#{app_root}/log/puma.stderr.log", true
end

変更することで出力できた

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?