[egg-logrotator] targetFile exists
- Dominant language
- TypeScript
- Stars
- 19k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
## What happens?
I have too many error like the following
```
2021-06-06 00:00:01,044 ERROR 2641 nodejs.Error: [egg-logrotator] rename /home/user/logs/app-web.log, found exception: targetFile /home/user/logs/app-web.log.2021-06-05 exists!!!
at renameOrDelete (/home/user/app/node_modules/egg-logrotator/app/lib/rotator.js:63:17)
at async DayRotator.rotate (/home/user/app/node_modules/egg-logrotator/app/lib/rotator.js:28:9)
at async Object.task (/home/user/app/node_modules/egg-logrotator/app/schedule/rotate_by_file.js:17:7)
pid: 2641
hostname: localhost
```
## Mini Showcase Repository(REQUIRED)
> Provide a mini GitHub repository which can reproduce the issue.
> Use `npm init egg --type=simple bug` then upload to your GitHub
N/A
## Context
- **Node Version**: v14.15.4
- **Egg Version**: 2.29.4
- **Plugin Name**: egg-logrotator
- **Plugin Version**: 3.1.0
- **Platform**: Centos 7
Contributor guide
Assessment
This issue has not been assessed yet.