-
Notifications
You must be signed in to change notification settings - Fork 28
Home
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:
-
Create the log worker like you do:
std::unique_ptrg3::LogWorker logworker {g3::LogWorker::createLogWorker()};
-
Add the logrotate sink:
auto handle = logworker->addSink(std2::make_unique("mylog", "/log_dir/"), &LogRotate::save);
-
Set Max Log Size:
std::future received = handle->call(&LogRotate::setMaxLogSize, 10000000);
-
Set Max Archive count:
std::future received1 = handle->call(&LogRotate::setMaxArchiveLogCount, 10);