Skip to content

Commit f84170d

Browse files
committed
Optimize spdlog
1 parent 43b5eb1 commit f84170d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: core/plugin/flusher/file/FlusherFile.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ bool FlusherFile::Init(const Json::Value& config, Json::Value& optionalGoPipelin
4848
GetMandatoryUIntParam(config, "MaxFiles", mMaxFileSize, errorMsg);
4949

5050
// create file writer
51+
auto threadPool = std::make_shared<spdlog::details::thread_pool>(10, 1);
5152
auto fileSink = std::make_shared<spdlog::sinks::rotating_file_sink_mt>(mFilePath, mMaxFileSize, mMaxFiles, true);
52-
mFileWriter = std::make_shared<spdlog::async_logger>(
53-
sName, fileSink, spdlog::thread_pool(), spdlog::async_overflow_policy::block);
53+
mFileWriter
54+
= std::make_shared<spdlog::async_logger>(sName, fileSink, threadPool, spdlog::async_overflow_policy::block);
5455
mFileWriter->set_pattern("%v");
5556

5657
mGroupSerializer = make_unique<JsonEventGroupSerializer>(this);

0 commit comments

Comments
 (0)