Skip to content

Commit

Permalink
Fix gzip header for compressed files during log file rotation
Browse files Browse the repository at this point in the history
An error in the gzip header (during log file rotation) resulted in
the linux "file" command thinking the original name of log files were
file.log.1.gz rather than file.log. This caused problems on Windows
with some of the GUI tools.

Fixes issue #26
  • Loading branch information
jeffaco committed Oct 9, 2018
1 parent 36a22c5 commit f2e7147
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rotatelogs.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func compressLogFile(logFileRoot string) error {
defer writer.Close()

archiver := gzip.NewWriter(writer)
archiver.Name = logFileRoot + ".1.gz"
archiver.Name = logFileRoot
defer archiver.Close()

if _, err := io.Copy(archiver, reader); err != nil {
Expand Down

0 comments on commit f2e7147

Please sign in to comment.