aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhiddenpath <hiddenpath@yandex-team.com>2025-02-21 16:21:32 +0300
committerhiddenpath <hiddenpath@yandex-team.com>2025-02-21 17:35:06 +0300
commit920d4009335be4e54e646c05ce025738cd8b3f2c (patch)
treea77eb5fb7ea87f01d43beef35a7741e3ac3fc039
parent13bd44e2d0fb2788d7b43edb92b1f10ff43b2da7 (diff)
downloadydb-920d4009335be4e54e646c05ce025738cd8b3f2c.tar.gz
YT-23616: Support ignoring specific log categories
commit_hash:9017070ae3bd4877019fc3510bdea4372801ea34
-rw-r--r--yt/cpp/mapreduce/client/init.cpp11
-rw-r--r--yt/cpp/mapreduce/interface/config.h1
2 files changed, 10 insertions, 2 deletions
diff --git a/yt/cpp/mapreduce/client/init.cpp b/yt/cpp/mapreduce/client/init.cpp
index 78c92ee883..04c4a4f007 100644
--- a/yt/cpp/mapreduce/client/init.cpp
+++ b/yt/cpp/mapreduce/client/init.cpp
@@ -179,9 +179,13 @@ void CommonInitialize(TGuard<TMutex>& g)
auto logPath = TConfig::Get()->LogPath;
if (logPath.empty()) {
+ auto coreLoggingConfig = NLogging::TLogManagerConfig::CreateStderrLogger(ToCoreLogLevel(logLevel));
+ for (const auto& rule : coreLoggingConfig->Rules) {
+ rule->ExcludeCategories = TConfig::Get()->LogExcludeCategories;
+ }
+ NLogging::TLogManager::Get()->Configure(coreLoggingConfig);
+
if (TConfig::Get()->LogUseCore) {
- auto coreLoggingConfig = NLogging::TLogManagerConfig::CreateStderrLogger(ToCoreLogLevel(logLevel));
- NLogging::TLogManager::Get()->Configure(coreLoggingConfig);
SetUseCoreLog();
} else {
auto logger = CreateStdErrLogger(logLevel);
@@ -189,6 +193,9 @@ void CommonInitialize(TGuard<TMutex>& g)
}
} else {
auto coreLoggingConfig = NLogging::TLogManagerConfig::CreateLogFile(logPath, ToCoreLogLevel(logLevel));
+ for (const auto& rule : coreLoggingConfig->Rules) {
+ rule->ExcludeCategories = TConfig::Get()->LogExcludeCategories;
+ }
NLogging::TLogManager::Get()->Configure(coreLoggingConfig);
SetUseCoreLog();
}
diff --git a/yt/cpp/mapreduce/interface/config.h b/yt/cpp/mapreduce/interface/config.h
index 7667335beb..5d0e0c1a94 100644
--- a/yt/cpp/mapreduce/interface/config.h
+++ b/yt/cpp/mapreduce/interface/config.h
@@ -87,6 +87,7 @@ struct TConfig
TString ApiVersion;
TString LogLevel;
TString LogPath;
+ THashSet<TString> LogExcludeCategories = {"Bus", "Net", "Dns", "Concurrency"};
///
/// For historical reasons mapreduce client uses its own logging system.