LoginSignup
0
1

More than 1 year has passed since last update.

[Rails]本番環境(CentOS)でエラーログを見る方法

Last updated at Posted at 2021-09-10

はじめに

CentOS上でrailsアプリを動かした際、エラーログの確認方法をまとめた。

環境

CentOS7
rails 6.1.4
capistrano 3.16.0
puma 4.3.8

本番エラーログ確認方法

#logディレクトリへ移動
$ cd /var/www/html/<アプリ名>/current/log
#lsコマンド入力
$ ls
capistrano.log  production.log  puma_access.log  puma_error.log

①capistrano.log → capistrano実行時のログやエラーログ
②production.log → アプリ実行時のログやエラーログ
③puma_access.log → pumaを起動した際のログ
④puma_error.log → puma実行時のエラーログ

#production.logの最新ログ20行分出力
$ tail -n 20 /var/www/html/<アプリ名>/current/log/production.log

まとめ

何かエラーが発生した場合は、まずはproduction.logを確認する。

参照

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