title: Limiting size of rotation logs in Boost Log v2
body: <p>I am a bit stuck to implement a very simple scenario with boost log. I need to limit the size of entire rotation log.</p>
  
  <p>My current logger configuration looks like that:</p>
  
  <pre><code>void setup_logging( channel_settings_t const&amp; settings
                  , std::string const&amp; log_file
                  , std::string const&amp; log_level
                  )
  {
    config_logger_attributes(logging::core::get(), settings, log_level);
  
    using namespace logging::aux::default_attribute_names;
  
    //add logging to file (which implicitly deletes the default console logger)
    logging::add_file_log
    (
      keywords::auto_flush = true,
      keywords::open_mode = std::ios::out | std::ios::app,
      keywords::file_name = log_file+"_%N.log",
      keywords::rotation_size = 50 * 1024, // Just for test limit to 50K
      keywords::format = //"%TimeStamp%: [%Channel%] |ThreadId| &lt;%Severity%&gt; %Message%"
        expr::format("%1% : [%2%] |%3%| &lt;%4%&gt; %5%")
        % expr::attr&lt; boost::posix_time::ptime &gt;(timestamp())
        % expr::attr&lt;std::string&gt;(channel())
        % expr::attr&lt;attrs::current_thread_id::value_type&gt;(thread_id())
        % trivial::severity
       % expr::smessage
    )-&gt;locked_backend()-&gt;set_file_collector
       ( sinks::file::make_collector
         ( keywords::target = "logs"
         , keywords::max_size = 200 * 1024 // just for test limit to 200K
         )
       )
    ;
  }
  </code></pre>
  
  <p>Unfortunately, I can't find what the target keyword means, despite the fact that it is a target directory. Target directory relating to smth or should there be a full path? Should this target directory exist? I did a test and rotating log files just grow upon the 200K limit.</p>
  
  <p>I just want to have let's say 3 or 4 last rotated log files, the rest should be removed? We already ran into the situation, where the logger used all disc space and the server crashed :(</p>
  
  <p>Any help if very appreciated!</p>