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?

【Rails】ログローテーションをする方法

Posted at

config/environments/production.rbなどの設定ファルに以下の設定を追記するとログローテーションができます。

# ファイルサイズ基準
config.logger = Logger.new("log/production.log", 5, 10 * 1024 * 1024)

# 日数基準
config.logger = Logger.new("log/production.log", 'daily')  # weeklyなども可

その他の方法

Linuxコマンドの logrotate コマンドを使用してもログローテーションが可能です。

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?