aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/diag
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-12-06 08:44:46 +0100
committerGitHub <[email protected]>2023-12-06 08:44:46 +0100
commit94fc3302c898825d7bc460ad4504577e33f744d9 (patch)
tree786ab5da6801dd5aabaca28f503c205af529363f /src/zenserver/diag
parentUse correct iterator index when looking up memcached payload in GatherReferen... (diff)
downloadzen-94fc3302c898825d7bc460ad4504577e33f744d9.tar.xz
zen-94fc3302c898825d7bc460ad4504577e33f744d9.zip
logging configuration via command line options (#589)
with these changes it is possible to configure loggers on the command line. For instance: `xmake run zenserver --log-trace=http_requests,http` will configure the system so that the `http_request` and `http` loggers are set to TRACE level
Diffstat (limited to 'src/zenserver/diag')
-rw-r--r--src/zenserver/diag/logging.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/zenserver/diag/logging.cpp b/src/zenserver/diag/logging.cpp
index e2d57b840..dc1675819 100644
--- a/src/zenserver/diag/logging.cpp
+++ b/src/zenserver/diag/logging.cpp
@@ -42,6 +42,7 @@ InitializeServerLogging(const ZenServerOptions& InOptions)
/* max files */ 16,
/* rotate on open */ true);
auto HttpLogger = std::make_shared<spdlog::logger>("http_requests", HttpSink);
+ spdlog::apply_logger_env_levels(HttpLogger);
spdlog::register_logger(HttpLogger);
// Cache request logging
@@ -53,16 +54,19 @@ InitializeServerLogging(const ZenServerOptions& InOptions)
/* max files */ 16,
/* rotate on open */ false);
auto CacheLogger = std::make_shared<spdlog::logger>("z$", CacheSink);
+ spdlog::apply_logger_env_levels(CacheLogger);
spdlog::register_logger(CacheLogger);
// Jupiter - only log upstream HTTP traffic to file
auto JupiterLogger = std::make_shared<spdlog::logger>("jupiter", FileSink);
+ spdlog::apply_logger_env_levels(JupiterLogger);
spdlog::register_logger(JupiterLogger);
// Zen - only log upstream HTTP traffic to file
auto ZenClientLogger = std::make_shared<spdlog::logger>("zenclient", FileSink);
+ spdlog::apply_logger_env_levels(ZenClientLogger);
spdlog::register_logger(ZenClientLogger);
FinishInitializeLogging(LogOptions);