aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/cache/structuredcachestore.h
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-09-22 10:04:02 -0400
committerGitHub <[email protected]>2023-09-22 16:04:02 +0200
commit47ba787e2cfe32b252b74e09494fbcaabc4e8190 (patch)
tree80acc5dfa51b08211583e38d31be2b2327a525a3 /src/zenserver/cache/structuredcachestore.h
parentadded support for sln on Mac (#421) (diff)
downloadzen-47ba787e2cfe32b252b74e09494fbcaabc4e8190.tar.xz
zen-47ba787e2cfe32b252b74e09494fbcaabc4e8190.zip
Add runtime status/control of logging (#419)
- Feature: New endpoint `/admin/logs` to query status of logging and log file locations and cache logging - `enablewritelog`=`true`/`false` parameter to control cache write logging - `enableaccesslog`=`true`/`false` parameter to control cache access logging - `loglevel` = `trace`/`debug`/`info`/`warning`/`error` - Feature: New zen command `logs` to query/control zen logging - No arguments gives status of logging and paths to log files - `--cache-write-log` `enable`/`disable` to control cache write logging - `--cache-access-log` `enable`/`disable` to control cache access logging - `--loglevel` `trace`/`debug`/`info`/`warning`/`error` to set debug level
Diffstat (limited to 'src/zenserver/cache/structuredcachestore.h')
-rw-r--r--src/zenserver/cache/structuredcachestore.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/zenserver/cache/structuredcachestore.h b/src/zenserver/cache/structuredcachestore.h
index 239efe68f..e7b64babe 100644
--- a/src/zenserver/cache/structuredcachestore.h
+++ b/src/zenserver/cache/structuredcachestore.h
@@ -122,8 +122,11 @@ public:
{
std::filesystem::path BasePath;
bool AllowAutomaticCreationOfNamespaces = false;
- bool EnableWriteLog = true;
- bool EnableAccessLog = true;
+ struct LogConfig
+ {
+ bool EnableWriteLog = true;
+ bool EnableAccessLog = true;
+ } Logging;
};
struct Info
@@ -159,6 +162,8 @@ public:
GcStorageSize StorageSize() const;
+ Configuration GetConfiguration() const { return m_Configuration; }
+ void SetLoggingConfig(const Configuration::LogConfig& Loggingconfig);
Info GetInfo() const;
std::optional<ZenCacheNamespace::Info> GetNamespaceInfo(std::string_view Namespace);
std::optional<ZenCacheNamespace::BucketInfo> GetBucketInfo(std::string_view Namespace, std::string_view Bucket);
@@ -201,6 +206,8 @@ private:
std::atomic_bool m_ExitLogging;
Event m_LogEvent;
std::thread m_AsyncLoggingThread;
+ std::atomic_bool m_WriteLogEnabled;
+ std::atomic_bool m_AccessLogEnabled;
};
void z$_forcelink();