buaazp / zimg

A lightweight and high performance image storage and processing system.
http://zimg.buaa.us
BSD 3-Clause "New" or "Revised" License
2.69k stars 402 forks source link

Zimg 3.1.0 log 不能rotate #166

Closed azuryyu closed 7 years ago

azuryyu commented 7 years ago

请问,如何配置 zimg 的log rotation?

buaazp commented 7 years ago

自带的log模块比较简单,没有这么高级的功能,建议用supervisor来启动,supervisor里自带了log切分。

azuryyu commented 7 years ago

谢谢回复,我配置了linux的 logrotate.d 解决了这个问题

azuryyu commented 7 years ago

Share the configuration here:

Suppose your Zimg located in /usr/local/zimg

vim /etc/logrotate.d/zimg #zimg is application name, you can specify by yourself

Add following inputs: /usr/local/zimg/zimg.log #absolute path of your zimg log file { daily #rotate log daily, you can use weekly or monthly. no others dateext #append '-YYYY-MM-DD' in the rotated log file name copytruncate #truncate the old file after rotate nocompress #don't compress the old log rotate 3 #keep max 3 rotated log files }

then:

service rsyslog restart #maybe it's 'syslog', not 'rsyslog', depends on your OS version.

buaazp commented 7 years ago

感谢分享!