Boost logo

Boost :

From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2019-07-19 23:03:45


On 7/20/19 1:09 AM, JH wrote:
> H Andrey and all,
>
> Can the log file be configured to set up the file size cap, when the
> log file reaches to the maximum file size, it deletes it and starts a
> new log file not rotates it?

You can write your own file collector that will just delete the file on
rotation. You will have to implement the `collector` interface:

https://github.com/boostorg/log/blob/ca227bc2f30d65f14719a674247728647caa2b2f/include/boost/log/sinks/text_file_backend.hpp#L74

Then you can set your collector to the sink backend and use the
rotation_size named parameter to limit the file size.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk