Skip to content

Commit

Permalink
Merge ad55f8a into backport/docs/monitor-command/violently-great-spaniel
Browse files Browse the repository at this point in the history
  • Loading branch information
hc-github-team-secure-vault-core authored Oct 24, 2024
2 parents 0e56cdb + ad55f8a commit 39054cd
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 27 deletions.
84 changes: 57 additions & 27 deletions website/content/docs/commands/monitor.mdx
Original file line number Diff line number Diff line change
@@ -1,47 +1,77 @@
---
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
`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.

## Examples
- If Vault is emitting log messages faster than a receiver can process them, the
some log lines will be dropped.

Monitor server logs at the `debug` log level:
<Tip title="Related API endpoints">

```shell-session
$ vault monitor -log-level=debug
```
MonitorLogs - [`GET: /sys/monitor`](/vault/api-docs/system/monitor)

</Tip>

## Usage
## Command arguments

The following flags are available in addition to the [standard set of
flags](/vault/docs/commands) included on all commands.
- None

### Output options
## Command 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.
- None

- `-log-format` `(string: "standard")` - Format to emit logs.
Valid formats are "standard", and "json".
If this option is not specified, "standard" is used.
## 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:

```shell-session
$ vault monitor -log-level=debug
```
8 changes: 8 additions & 0 deletions website/content/partials/cli/monitor/flags/log-format.mdx
Original file line number Diff line number Diff line change
@@ -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"`
9 changes: 9 additions & 0 deletions website/content/partials/cli/monitor/flags/log-level.mdx
Original file line number Diff line number Diff line change
@@ -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`

0 comments on commit 39054cd

Please sign in to comment.