8
11

More than 5 years have passed since last update.

Macでログローテートしたい

Posted at

最初から入ってるnewsyslogを使うのが簡単そうだったので、やってみたメモ。

設定ファイルの場所

newsyslog.confは特にいじらず、newsyslog.d配下に適当な名前でconfを作成する

/etc/newsyslog.conf
/etc/newsyslog.d/

設定ファイルに書いてみた

詳しいことはリファレンスを読もう

# logfilename          [owner:group]    mode count size when  flags [/pid_file] [sig_num]
/var/log/nginx/*.log                       640  5     1024 *     GJ

テスト

$sudo newsyslog -nv

実行

$ sudo newsyslog

たぶんok

8
11
1

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
8
11