From 310ef3b31e1d941c2956567e3cd29c9b26a80c29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 21 Jul 2017 09:11:20 +0300 Subject: [PATCH] MXS-1300: Add `show logging` command The show logging command shows the current log file and the logging parameters. --- maxctrl/lib/show.js | 11 ++++++++++- server/core/log_manager.cc | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/maxctrl/lib/show.js b/maxctrl/lib/show.js index 0b3087af9..22ab28784 100644 --- a/maxctrl/lib/show.js +++ b/maxctrl/lib/show.js @@ -103,7 +103,16 @@ exports.builder = function(yargs) { {'Version': 'attributes.version'}, {'Commit': 'attributes.commit'}, {'Started At': 'attributes.started_at'}, - {'Uptime': 'attributes.uptime'} + {'Uptime': 'attributes.uptime'}, + {'Parameters': 'attributes.parameters'} + ]) + }) + }) + .command('logging', 'Show MaxScale logging information', {}, function(argv) { + maxctrl(argv, function(host) { + return getResource(host, 'maxscale/logs', [ + {'Current Log File': 'attributes.log_file'}, + {'Parameters': 'attributes.parameters'} ]) }) }) diff --git a/server/core/log_manager.cc b/server/core/log_manager.cc index bec97ab72..a5f248bd6 100644 --- a/server/core/log_manager.cc +++ b/server/core/log_manager.cc @@ -3037,6 +3037,7 @@ json_t* mxs_logs_to_json(const char* host) json_t* attr = json_object(); json_object_set_new(attr, CN_PARAMETERS, param); + json_object_set_new(attr, "log_file", json_string(lm->lm_filewriter.fwr_file->sf_fname)); json_t* data = json_object(); json_object_set_new(data, CN_ATTRIBUTES, attr);