egg-logrotator
egg-logrotator copied to clipboard
feat: add disableRotateByDay configuration(default:false)
Checklist
- [x]
npm testpasses - [x] tests and/or benchmarks are included
- [ ] documentation is changed or added
- [x] commit message follows commit guidelines
Affected core subsystem(s)
Description of change
add disableRotateByDay configuration(default:false)
https://github.com/eggjs/egg/issues/4222
Codecov Report
Merging #28 into master will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## master #28 +/- ##
=======================================
Coverage 96.19% 96.19%
=======================================
Files 14 14
Lines 210 210
=======================================
Hits 202 202
Misses 8 8
| Impacted Files | Coverage Δ | |
|---|---|---|
| app/schedule/rotate_by_file.js | 100.00% <ø> (ø) |
|
| config/config.default.js | 100.00% <ø> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 46b6876...bb436f9. Read the comment docs.
这个的场景是?
这个的场景是?
https://github.com/eggjs/egg/issues/4222 可以配置,禁用默认按天的日志切割。 @atian25
印象中里面提到的应该是单个的禁用,即有其他策略时就不切文件,而不是全局禁用吧,明天看下
@atian25 1.目前,hour的分割方式,受filesRotateByHour配置项控制。size的分割方式,受filesRotateBySize控制。如果前两者都配置为空,则不会启用。file方式取的系统配置项,没有提供可以禁用的选项。可以采用类似方案,给day提供一个files的配置控制。这样与hour,size的方式一致。 2.如果采用,用户自定义方式,且不存在1的配置。如果用户提供了自定义的方式,那么就禁用系统默认的。这样是不是就完全用户自定义了?我看自定义方式上传了app对象。就可以获取到所有的文件目录。用户完全自定义。用户自由度更高的一个方案。 Update: #4222 里面,需求是:切割时间,文件名,存放目录,均自定义。