diff --git a/client/maxctrl/lib/alter.js b/client/maxctrl/lib/alter.js index 7c3cf2e15..779a1985d 100644 --- a/client/maxctrl/lib/alter.js +++ b/client/maxctrl/lib/alter.js @@ -26,6 +26,9 @@ exports.builder = function(yargs) { .command('service ', 'Alter service parameters', {}, function(argv) { updateValue('services/' + argv.service, "data.attributes.parameters." + argv.key, argv.value) }) + .command('logging ', 'Alter logging parameters', {}, function(argv) { + updateValue('maxscale/logs', "attributes.parameters." + argv.key, argv.value) + }) .command('maxscale ', 'Alter MaxScale parameters', {}, function(argv) { updateValue('maxscale', "attributes.parameters." + argv.key, argv.value) }) diff --git a/client/maxctrl/lib/rotate.js b/client/maxctrl/lib/rotate.js new file mode 100644 index 000000000..6e37b39b4 --- /dev/null +++ b/client/maxctrl/lib/rotate.js @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2016 MariaDB Corporation Ab + * + * Use of this software is governed by the Business Source License included + * in the LICENSE.TXT file and at www.mariadb.com/bsl11. + * + * Change Date: 2020-01-01 + * + * On the date above, in accordance with the Business Source License, use + * of this software will be governed by version 2 or later of the General + * Public License. + */ +require('../common.js')() + +exports.command = 'rotate ' +exports.desc = 'Rotate log files' +exports.handler = function() {} +exports.builder = function(yargs) { + yargs + .command('logs', 'Rotate log files by closing and reopening the files', {}, function(argv) { + doRequest('maxscale/logs/flush/', null, {method: 'POST'}) + }) + .usage('Usage: rotate ') + .help() + .command('*', 'the default command', {}, () => { + console.log('Unknown command. See output of `help rotate` for a list of commands.') + }) +} diff --git a/client/maxctrl/maxctrl.js b/client/maxctrl/maxctrl.js index 22ed86e87..b028c2d56 100644 --- a/client/maxctrl/maxctrl.js +++ b/client/maxctrl/maxctrl.js @@ -63,6 +63,7 @@ program .command(require('./lib/start.js')) .command(require('./lib/stop.js')) .command(require('./lib/alter.js')) + .command(require('./lib/rotate.js')) .help() .demandCommand(1, 'At least one command is required') .command('*', 'the default command', {}, () => {