natefinch / lumberjack

lumberjack is a log rolling package for Go
MIT License
4.71k stars 578 forks source link

gzip: *.log.gz: not in gzip format #188

Open wuyinq opened 1 year ago

wuyinq commented 1 year ago

gunzip the zipped log file occurs error like this: image

And this is the log init function: image

dveeden commented 7 months ago
$ hexdump -C -n2 my.log.gz
00000000  1f 8b                                             |..|
00000002
$ file my.log.gz
my.log.gz: gzip compressed data, original size modulo 2^32 1413

gzip files start with 0x1F, 0x1B (see also "Magic number" on https://en.wikipedia.org/wiki/Gzip). Do your files have the same start bytes?

wuyinq commented 7 months ago
$ hexdump -C -n2 my.log.gz
00000000  1f 8b                                             |..|
00000002
$ file my.log.gz
my.log.gz: gzip compressed data, original size modulo 2^32 1413

gzip files start with 0x1F, 0x1B (see also "Magic number" on https://en.wikipedia.org/wiki/Gzip). Do your files have the same start bytes?

No, brother, I get this:

$ hexdump -C -n2 **.log.gz
00000000   00  00
00000002
$ file **.log.gz
**.log.gz: data