egg-logrotator icon indicating copy to clipboard operation
egg-logrotator copied to clipboard

feat: add disableRotateByDay configuration(default:false)

Open qingdengyue opened this issue 5 years ago • 6 comments

Checklist
  • [x] npm test passes
  • [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)

qingdengyue avatar Sep 21 '20 10:09 qingdengyue

https://github.com/eggjs/egg/issues/4222

qingdengyue avatar Sep 21 '20 10:09 qingdengyue

Codecov Report

Merging #28 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           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 data Powered by Codecov. Last update 46b6876...bb436f9. Read the comment docs.

codecov[bot] avatar Sep 21 '20 11:09 codecov[bot]

这个的场景是?

atian25 avatar Sep 23 '20 06:09 atian25

这个的场景是?

https://github.com/eggjs/egg/issues/4222 可以配置,禁用默认按天的日志切割。 @atian25

qingdengyue avatar Sep 23 '20 09:09 qingdengyue

印象中里面提到的应该是单个的禁用,即有其他策略时就不切文件,而不是全局禁用吧,明天看下

atian25 avatar Sep 23 '20 15:09 atian25

@atian25 1.目前,hour的分割方式,受filesRotateByHour配置项控制。size的分割方式,受filesRotateBySize控制。如果前两者都配置为空,则不会启用。file方式取的系统配置项,没有提供可以禁用的选项。可以采用类似方案,给day提供一个files的配置控制。这样与hour,size的方式一致。 2.如果采用,用户自定义方式,且不存在1的配置。如果用户提供了自定义的方式,那么就禁用系统默认的。这样是不是就完全用户自定义了?我看自定义方式上传了app对象。就可以获取到所有的文件目录。用户完全自定义。用户自由度更高的一个方案。 Update: #4222 里面,需求是:切割时间,文件名,存放目录,均自定义。

qingdengyue avatar Sep 24 '20 06:09 qingdengyue