   Compression DLL
  I’ve made a logging class so that I can update a log file during program execution. Thing is, I want to be able to compress the Log. Does anyone know of a free commercial DLL which will allow me to compress the log file? I’ve found 7z.dll but it seems like a huge pain to use. Does anyone have experience doing this and what are my options?   
  If you are on Windows, set log directory to compressed.If you are on nix-ish platforms, use compressing file system.One thing you want to do is keep logs human readable. If application crashes or something goes wrong, your compressor will never be able to emit the last chunk, the size of which may vary depending on method, and may cause you to considerable number of logs. The last ones are often the most critical.While it is possible to flush compressors after each log, it will reduce the compression ratio well beyond what file system compression can do. And that one can be used by flushing after each log entry.If this is for more persistent logging, then simply accept that you will use several gigabytes. It's not like it's a problem.   ;  What do you mean by "free commercial" dll? Do you want dll for free, or commercial?Anyway - 7z has zlib library you build dll for deflate compression.Also nice and very small library is    ;Quote:Original post by AntheusIf you are on Windows, set log directory to compressed.If you are on nix-ish platforms, use compressing file system.One thing you want to do is keep logs human readable. If application crashes or something goes wrong, your compressor will never be able to emit the last chunk, the size of which may vary depending on method, and may cause you to considerable number of logs. The last ones are often the most critical.While it is possible to flush compressors after each log, it will reduce the compression ratio well beyond what file system compression can do. And that one can be used by flushing after each log entry.If this is for more persistent logging, then simply accept that you will use several gigabytes. It's not like it's a problem.Thanks for the prompt reply. My Main purpose of compression is to compress the file when something goes wrong and send the file over a network. Therefore, the file IS NOT compressed at all time.  I'm thinking about making the log compressed only with a call a function within my Log class. When you have 1000 people sending a txt file to a server it can really cause problems.. sorry for not giving the entire story before.   ;zlib is the de-facto standard compressor.Quote:I'm thinking about making the log compressed only with a call a function within my Log classYour networking code should be doing the compression. Logger has no need for such functionality.   ;  Thank you! zlib FTW! :D   