LoginSignup
1
1

More than 1 year has passed since last update.

AWS EC2で立ち上げたRails(unicorn)サーバーのログ確認方法

Posted at

前提条件

RailsアプリをEC2(unicorn)にデプロイして、サーバー起動済みの場合のログ確認方法

結論

該当アプリのlogディレクトリで以下のコマンドを実行すればOK

terminal(EC2インスタンス内)
$ tail -f production.log

詳細

デプロイしたリポジトリで以下のコマンドを実行してください!

terminal(EC2インスタンス内)
$ ls
Gemfile  Gemfile.lock  README.md  Rakefile  app  bin  config  config.ru  csv  db  lib  log  public  spec  storage  tmp  vendor

$ cd log

$ ls
production.log  unicorn.stderr.log  unicorn.stdout.log

$ tail -f production.log
以下にサーバーのログが流れてくる

tailコマンドについて

ファイルの最終行から数行を表示する。
-fオプションをつけた場合、ファイルの追記を監視し、随時表示する。
(ローカルのrails sのようにログを表示することができる。)

参考にさせていただいた記事🙇‍♂️

最後に

本記事の内容がネット上にあまりなかったので執筆しました。
この記事が多くの悩める方に届くことを願っています🌱

1
1
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
1
1