Skip to content

Commit

Permalink
fixed: business
Browse files Browse the repository at this point in the history
  • Loading branch information
SliverHorn committed Aug 7, 2023
1 parent 6b4c0be commit ac1e620
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rotatelogs.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,10 @@ func (rl *RotateLogs) Write(bytes []byte) (n int, err error) {
func (rl *RotateLogs) getWriterNolock(bailOnRotateFail, useGenerationalNames bool, business string) (io.Writer, error) {
if business != "" {
slice := strings.Split(rl.pattern.Pattern(), "/")
slice = append(slice[:len(slice)-1], business, slice[len(slice)-1])
rl.pattern, _ = strftime.New(strings.Join(slice, "/"))
if slice[len(slice)-2] != business {
slice = append(slice[:len(slice)-1], business, slice[len(slice)-1])
rl.pattern, _ = strftime.New(strings.Join(slice, "/"))
}
}
generation := rl.generation
previousFn := rl.curFn
Expand Down

0 comments on commit ac1e620

Please sign in to comment.