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.

tomcat catalina.out copytruncate not work

Posted at

tomcat のログが追記される。

logrotate setting

/var/log/tomcat8/catalina.out {
    copytruncate
    daily
    rotate 10
    compress
    missingok
    dateext
    create 0644 tomcat tomcat
}

以下、今回はおそらく、copytruncate がうまく動いていないと思われる。

copytruncate:コピー後、元のログファイルの内容を消去する
daily:1日1回ローテーションを実行する
rotate:残す世代数(ファイル数と考えてもらえれば...環境に合わせて変更してください。)
compress:最新世代以外は圧縮する
missingok:指定のログファイルが存在していなくてもエラーを出さない
dateext:ファイル名の末尾に日付をつける
create 0644 tomcat tomcat:ログファイルの権限

参考1

/log/apache-tomcat/catalina.out{
 su tomcat tomcat
 copytruncate
 daily
 size 256M
 rotate 8
 missingok
 maxage 7
}
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?