Skip to content

Commit

Permalink
修改getFileRollName
Browse files Browse the repository at this point in the history
  • Loading branch information
wangdongming committed May 20, 2022
1 parent e293b68 commit aeaa51a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion writers_rollingfilewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,8 @@ func (rw *rollingFileWriter) deleteOldRolls(history []string) error {
}

func (rw *rollingFileWriter) getFileRollName(fileName string) string {
fileName = strings.ReplaceAll(fileName, "{$date}", "")
// 将DATA标记替换成标准日期,便于长度一致。
fileName = strings.ReplaceAll(fileName, "{$date}", "2006-01-02")
switch rw.nameMode {
case rollingNameModePostfix:
return fileName[len(fileName+rollingLogHistoryDelimiter):]
Expand Down

0 comments on commit aeaa51a

Please sign in to comment.