0

typedef sinks::asynchronous_sink<sinks::text_file_backend> AsyncProjecteLogWritter; sink_3 = boost::make_shared<AsyncProjecteLogWritter>( keywords::file_name="projectlog", keywords::rotation_size=1024*5, keywords::open_mode = std::ios_base::app ); sink_3->locked_backend()->set_file_collector(sinks::file::make_collector( keywords::target = "oldfilelog",
keywords::max_size = 10000,
keywords::min_free_space = 100 * 1024 * 1024 )); sink_3->locked_backend()->scan_for_files();

I am trying to limit size of log file(suppose log.txt) around 5kb but when I tried to log in to the file(log.txt) log file goes beyond 5kb and keeps logging in to old log file(log.txt) instead of limit it self to 5kb and create a new file(log.txt0000) it keeps logging in to log.txt. i tried some demo codes http://www.boost.org/doc/libs/1_57_0/libs/log/example/doc/sinks_xml_file.cpp

mentioned in given link if file(suppose log.txt) have some space like 2kb is remaining to reach up to limit and I close application and again I reopen than log should start from the old log file(log.txt) in which 2kb space is remaining to reach up to limit but instead of that new file get created (some thing like log.txt0000)

ganesh
  • 171
  • 1
  • 2
  • 13
  • "goes beyond 5kb"? by how much? Is it just the last write before the limit that completes despite being too large, or can you keep writing without the limit kicking in - and if so for how long? – Tony Delroy Aug 31 '15 at 07:40
  • it is limit less even though i set limit 5kb – ganesh Aug 31 '15 at 07:45

0 Answers0