Problems with file rotation after adding append flag in Boost 1.59 log v2

前端 未结 1 1417
礼貌的吻别
礼貌的吻别 2021-01-07 07:39

After adding append flag \"keywords::open_mode = std::ios_base::app\" to file sink the normal file rotation is not happening when the file reaches Max size,

相关标签:
1条回答
  • 2021-01-07 08:21

    In your program, you give same rotation size and maximum size this may be a problem. So try by giving maximum size as 5000000 and rotation size as 500000 (maximum size / 10). So that you may have 9 or 10 files before reaching maximum size.

    Another thing is maximum size you set here is for folder (i.e.: //tmp - folder). Once the files (all files) reaches the size of maximum then old file gets deleted and new file will be placed in that folder.

    Another thing is you can set file name as test_%N.log. So that your rotated file gets new name as test_1.log, test_2.log, etc.

    Refer this site : http://boost-log.sourceforge.net/libs/log/doc/html/log/detailed/sink_backends.html

    0 讨论(0)
提交回复
热议问题