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 <yoko@hashicorp.com>
This commit is contained in:
Kianna
2024-10-24 11:22:03 -07:00
committed by GitHub
parent 48cf1a1809
commit ad55f8aaa3
3 changed files with 74 additions and 27 deletions

View File

@@ -1,28 +1,73 @@
---
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`.
<CodeBlockConfig hideClipboard>
```shell-session
$ vault monitor [flags]
$ vault monitor [-help | -h]
```
</CodeBlockConfig>
## 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
### Limitations and warnings
- 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
- If Vault is emitting log messages faster than a receiver can process them, the
some log lines will be dropped.
<Tip title="Related API endpoints">
MonitorLogs - [`GET: /sys/monitor`](/vault/api-docs/system/monitor)
</Tip>
## Command arguments
- None
## Command options
- None
## Command flags
<br />
@include 'cli/monitor/flags/log-level.mdx'
<br />
<hr />
<br />
@include 'cli/monitor/flags/log-format.mdx'
## Standard flags
@include 'cli/standard-settings/all-standard-flags.mdx'
## Examples
Monitor server logs at the `debug` log level:
@@ -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.

View File

@@ -0,0 +1,8 @@
<a id="monitor-flag-log-format" />
**`-log-format (string : "standard")`**
Format to emit logs.
Valid formats are "standard", and "json".
**Example**: `-log-format "standard"`

View File

@@ -0,0 +1,9 @@
<a id="monitor-flag-log-level" />
**`-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`