mak*_*mak 35
永远本身不支持日志轮换,日志轮换仍然是Winston 的待处理功能请求.
您可以使用logrotate大多数Linux发行版中包含的内容,用于旋转系统日志文件,以及其他软件(如Apache)使用.
添加文件到 /etc/logrotate.d/
/path/to/server.log {
daily # how often to rotate
rotate 10 # max num of log files to keep
missingok # don't panic if the log file doesn't exist
notifempty # ignore empty files
compress # compress rotated log file with gzip
sharedscripts # postrotate script (if any) will be run only once at the end, not once for each rotated log
copytruncate # needed for forever to work properly
dateext # adds date to filename
dateformat %Y-%m-%d.
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13427 次 |
| 最近记录: |