Hi All,

Link: 
http://stackoverflow.com/questions/34037325/problems-with-file-rotation-after-adding-append-flag-in-boost-1-59-log-v2

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, 
as specified in below code:

typedef sinks::synchronous_sink< sinks::text_file_backend > file_sink;
        boost::shared_ptr< logging::core > core = logging::core::get();
        boost::shared_ptr< file_sink > sink(new file_sink(
            keywords::file_name =  "test.log",
            keywords::open_mode = std::ios_base::app,
            keywords::rotation_size = 5000000
            ));
        sink->locked_backend()->set_file_collector(sinks::file::make_collector(
            keywords::target = "tmp",
            keywords::max_size = 10000,
            keywords::min_free_space = 1000
            ));
        sink->locked_backend()->scan_for_files();
        sink->locked_backend()->auto_flush(true);
        core->add_sink(sink);
Boost Log version: 1.59

Behavior observed: After every time the process using boost logger starts; the 
log messages are getting appended to existing log file instead of creating new 
log file. But when the log file reaches it max size then boost file rotation 
policy is not happening and new log file is getting created without moving old 
log file to target directory.

Expected behavior: The log file should be appended with log messages and when 
reaches max size it should be rotated properly.

Any help.

Thanks in advance,
arun.

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to