4

I need to zip logs, produced by Boost Logging library. I see 2 approaches:

  1. Compress logs on the fly to BZip or GZip - preferably
  2. Compress logs when rotating (make copy of log and zip it).

How do I implement this?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Heavy
  • 1,861
  • 14
  • 25
  • how about man logrotate? – Sam Miller Mar 15 '13 at 02:58
  • My program will run under WIN32, so I can't use logrotate. I also want to implement archivation in program, without using external stuff. – Heavy Mar 15 '13 at 06:28
  • 1
    I think, what my question isn't obvious, so why you downvote? I'm trying to find out the most beautiful way. I could use cron or anything, but I want to implement it in my program. – Heavy Mar 15 '13 at 06:33
  • 3
    Have you considered [Boost Iostreams](http://www.boost.org/doc/libs/1_53_0/libs/iostreams/doc/index.html) zlib or bzip filters? – Grigorii Chudnov Mar 16 '13 at 21:14

1 Answers1

0

Boost has gzip filters, which could be attached to a logging sink.

Heavy
  • 1,861
  • 14
  • 25