Skip to content
Rakesh Sehgal edited this page May 25, 2016 · 3 revisions

Welcome to the g3sinks wiki!

I know it's pretty easy to use, but took my a little while to figure this out. You can use the Logrotate as follows:

  1. Create the log worker like you do:

    std::unique_ptrg3::LogWorker logworker {g3::LogWorker::createLogWorker()};

  2. Add the logrotate sink:

    auto handle = logworker->addSink(std2::make_unique("mylog", "/log_dir/"), &LogRotate::save);

  3. Set Max Log Size:

    std::future received = handle->call(&LogRotate::setMaxLogSize, 10000000);

  4. Set Max Archive count:

    std::future received1 = handle->call(&LogRotate::setMaxArchiveLogCount, 10);

Clone this wiki locally