Boost log to limit log file maximum file size
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? Thank you. - jupiter
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/ca227bc2f30d65f14719a674247728647caa2b2... Then you can set your collector to the sink backend and use the rotation_size named parameter to limit the file size.
participants (2)
-
Andrey Semashev
-
JH