From ad55f8aaa389d1c4969499ff489d0d318f4ac39f Mon Sep 17 00:00:00 2001 From: Kianna <30884335+kiannaquach@users.noreply.github.com> Date: Thu, 24 Oct 2024 11:22:03 -0700 Subject: [PATCH] Restructure monitor command docs and add monitor partial (#28753) * Restructure and add partial * Update website/content/docs/commands/monitor.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/docs/commands/monitor.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/partials/cli/monitor/flags/log-format.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/partials/cli/monitor/flags/log-format.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/partials/cli/monitor/flags/log-format.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/partials/cli/monitor/flags/log-level.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/partials/cli/monitor/flags/log-level.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/partials/cli/monitor/flags/log-level.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Address feedback --------- Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> Co-authored-by: Yoko Hyakuna --- website/content/docs/commands/monitor.mdx | 84 +++++++++++++------ .../partials/cli/monitor/flags/log-format.mdx | 8 ++ .../partials/cli/monitor/flags/log-level.mdx | 9 ++ 3 files changed, 74 insertions(+), 27 deletions(-) create mode 100644 website/content/partials/cli/monitor/flags/log-format.mdx create mode 100644 website/content/partials/cli/monitor/flags/log-level.mdx diff --git a/website/content/docs/commands/monitor.mdx b/website/content/docs/commands/monitor.mdx index 53af78d052..3c5aba2d86 100644 --- a/website/content/docs/commands/monitor.mdx +++ b/website/content/docs/commands/monitor.mdx @@ -1,27 +1,72 @@ --- layout: docs -page_title: monitor - Command +page_title: 'monitor - Vault CLI' description: |- - The "monitor" command displays the server logs of a Vault server in real - time. + Display the server logs of a Vault server in real time. --- -# monitor +# `monitor` -The `monitor` command shows a real time display of the server logs of a Vault +Stream Vault server logs in real-time to `stdout`. + + + +```shell-session +$ vault monitor [flags] + +$ vault monitor [-help | -h] +``` + + + +## Description + +`vault monitor` command shows a real time display of the server logs of a Vault server. This command accepts a log level as an argument, which can be different from the log level that the Vault server was started with. -The `monitor` command honors the `VAULT_ADDR` environment variable. The address +`vault monitor` honors the `VAULT_ADDR` environment variable. The address specified determines the target server that will be monitored. -Note that this command is designed to run indefinitely. It is similar to -`tail -f` in the Unix world. This command will not exit on its own unless -it encounters an unexpected error. As a user, you must terminate this -process yourself to shut it down. +### Limitations and warnings -If Vault is emitting log messages faster than a receiver can process them, the -some log lines will be dropped. +- Note that this command is designed to run indefinitely. It is similar to + `tail -f` in the Unix world. This command will not exit on its own unless + it encounters an unexpected error. As a user, you must terminate this + process yourself to shut it down. + +- If Vault is emitting log messages faster than a receiver can process them, the + some log lines will be dropped. + + + +MonitorLogs - [`GET: /sys/monitor`](/vault/api-docs/system/monitor) + + + +## Command arguments + +- None + +## Command options + +- None + +## Command flags + +
+ +@include 'cli/monitor/flags/log-level.mdx' + +
+
+
+ +@include 'cli/monitor/flags/log-format.mdx' + +## Standard flags + +@include 'cli/standard-settings/all-standard-flags.mdx' ## Examples @@ -30,18 +75,3 @@ Monitor server logs at the `debug` log level: ```shell-session $ vault monitor -log-level=debug ``` - -## Usage - -The following flags are available in addition to the [standard set of -flags](/vault/docs/commands) included on all commands. - -### Output options - -- `-log-level` `(string: "info")` - Monitor the Vault server at this log level. - Valid log levels are (in order of detail) "trace", "debug", "info", - "warn", "error". If this option is not specified, "info" is used. - -- `-log-format` `(string: "standard")` - Format to emit logs. - Valid formats are "standard", and "json". - If this option is not specified, "standard" is used. diff --git a/website/content/partials/cli/monitor/flags/log-format.mdx b/website/content/partials/cli/monitor/flags/log-format.mdx new file mode 100644 index 0000000000..321c66b102 --- /dev/null +++ b/website/content/partials/cli/monitor/flags/log-format.mdx @@ -0,0 +1,8 @@ + + +**`-log-format (string : "standard")`** + +Format to emit logs. +Valid formats are "standard", and "json". + +**Example**: `-log-format "standard"` diff --git a/website/content/partials/cli/monitor/flags/log-level.mdx b/website/content/partials/cli/monitor/flags/log-level.mdx new file mode 100644 index 0000000000..3fe5168563 --- /dev/null +++ b/website/content/partials/cli/monitor/flags/log-level.mdx @@ -0,0 +1,9 @@ + + +**`-log-level (enum : info)`** + +Monitor the Vault server at this log level. +Valid log levels are (in order of detail) "trace", "debug", "info", +"warn", "error". + +**Example**: `-log-level debug`