I'm using the Boost Log V2 to create log files from my application.
I have configured the log file to rotate by size using this naming configuration:
keywords::file_name = "application_%N.log",
keywords::rotation_size = 5 * 1024 * 1024,
keywords::max_size = 16 * 1024 * 1024,
This will ensure to rotate the file naming them:
application_1.log, application_2.log, application_3.log .... application_N.log
The newest file is the N file. Is there any option to make the newest file always be the same one (like 'application_0.log')?
I need to be able to watch the latest log file for changes and in this configuration, it always changes.
Is there any option to make the newest file always be the same one (like 'application_0.log')?
No, this is not supported. You will have to implement your own file collector that derives from collector
interface and performs the necessary actions on file rotation. Note that the file name is generated by the sink backend, which means that you may need to modify it as well.