diff options
| author | Dan Engelbrecht <[email protected]> | 2023-09-22 10:04:02 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-09-22 16:04:02 +0200 |
| commit | 47ba787e2cfe32b252b74e09494fbcaabc4e8190 (patch) | |
| tree | 80acc5dfa51b08211583e38d31be2b2327a525a3 /src/zen/cmds/admin_cmd.h | |
| parent | added support for sln on Mac (#421) (diff) | |
| download | archived-zen-47ba787e2cfe32b252b74e09494fbcaabc4e8190.tar.xz archived-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/zen/cmds/admin_cmd.h')
| -rw-r--r-- | src/zen/cmds/admin_cmd.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/zen/cmds/admin_cmd.h b/src/zen/cmds/admin_cmd.h index 6caab7138..873c230d9 100644 --- a/src/zen/cmds/admin_cmd.h +++ b/src/zen/cmds/admin_cmd.h @@ -73,4 +73,23 @@ private: bool m_Cancel = 0; }; +//////////////////////////////////////////// + +class LoggingCommand : public ZenCmdBase +{ +public: + LoggingCommand(); + ~LoggingCommand(); + + virtual int Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) override; + virtual cxxopts::Options& Options() override { return m_Options; } + +private: + cxxopts::Options m_Options{"logs", "Show/control zen logging"}; + std::string m_HostName; + std::string m_CacheWriteLog; + std::string m_CacheAccessLog; + std::string m_SetLogLevel; +}; + } // namespace zen |