auto sink = boost::log::add_file_log(
boost::log::keywords::auto_flush = true,
boost::log::keywords::enable_final_rotation = false,
boost::log::keywords::file_name = logDir / (name + ".log"),
boost::log::keywords::open_mode = (std::ios::out | std::ios::app),
boost::log::keywords::scan_method = boost::log::sinks::file::scan_matching,
boost::log::keywords::target = logDir,
boost::log::keywords::target_file_name = logDir / (name + "_%N.log"),
// Other args
);
In my server such sink causes a huge slowdown (15 times less RPS).
Here are some perf
results got in RelWithDebInfo: my code with this sink shows 81% for push_record_move
. But if I change target_file_name to some other dir, it is only 1.2%.
Why is that?
New contributor
Maksim Popov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.