Skip to content

Commit 228cdec

Browse files
hiddenpathblinkov
authored andcommitted
YT-23616: Support ignoring specific log categories
commit_hash:9017070ae3bd4877019fc3510bdea4372801ea34
1 parent cf4d555 commit 228cdec

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

yt/cpp/mapreduce/client/init.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,23 @@ void CommonInitialize(TGuard<TMutex>& g)
179179

180180
auto logPath = TConfig::Get()->LogPath;
181181
if (logPath.empty()) {
182+
auto coreLoggingConfig = NLogging::TLogManagerConfig::CreateStderrLogger(ToCoreLogLevel(logLevel));
183+
for (const auto& rule : coreLoggingConfig->Rules) {
184+
rule->ExcludeCategories = TConfig::Get()->LogExcludeCategories;
185+
}
186+
NLogging::TLogManager::Get()->Configure(coreLoggingConfig);
187+
182188
if (TConfig::Get()->LogUseCore) {
183-
auto coreLoggingConfig = NLogging::TLogManagerConfig::CreateStderrLogger(ToCoreLogLevel(logLevel));
184-
NLogging::TLogManager::Get()->Configure(coreLoggingConfig);
185189
SetUseCoreLog();
186190
} else {
187191
auto logger = CreateStdErrLogger(logLevel);
188192
SetLogger(logger);
189193
}
190194
} else {
191195
auto coreLoggingConfig = NLogging::TLogManagerConfig::CreateLogFile(logPath, ToCoreLogLevel(logLevel));
196+
for (const auto& rule : coreLoggingConfig->Rules) {
197+
rule->ExcludeCategories = TConfig::Get()->LogExcludeCategories;
198+
}
192199
NLogging::TLogManager::Get()->Configure(coreLoggingConfig);
193200
SetUseCoreLog();
194201
}

yt/cpp/mapreduce/interface/config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ struct TConfig
8787
TString ApiVersion;
8888
TString LogLevel;
8989
TString LogPath;
90+
THashSet<TString> LogExcludeCategories = {"Bus", "Net", "Dns", "Concurrency"};
9091

9192
///
9293
/// For historical reasons mapreduce client uses its own logging system.

0 commit comments

Comments
 (0)