2014-02-08 00:41:03 +00:00
|
|
|
---
|
2020-04-07 18:55:19 +00:00
|
|
|
layout: docs
|
|
|
|
page_title: 'Commands: Monitor'
|
2020-04-07 23:56:08 +00:00
|
|
|
sidebar_title: 'monitor'
|
2020-04-07 18:55:19 +00:00
|
|
|
sidebar_current: docs-commands-monitor
|
|
|
|
description: >-
|
|
|
|
The `monitor` command is used to connect and follow the logs of a running
|
|
|
|
Consul agent. Monitor will show the recent logs and then continue to follow
|
|
|
|
the logs, not exiting until interrupted or until the remote agent quits.
|
2014-02-08 00:41:03 +00:00
|
|
|
---
|
|
|
|
|
2014-02-19 01:32:13 +00:00
|
|
|
# Consul Monitor
|
2014-02-08 00:41:03 +00:00
|
|
|
|
2014-02-19 01:32:13 +00:00
|
|
|
Command: `consul monitor`
|
2014-02-08 00:41:03 +00:00
|
|
|
|
2014-10-19 23:40:10 +00:00
|
|
|
The `monitor` command is used to connect and follow the logs of a running
|
2014-02-19 01:32:13 +00:00
|
|
|
Consul agent. Monitor will show the recent logs and then continue to follow
|
2014-02-08 00:41:03 +00:00
|
|
|
the logs, not exiting until interrupted or until the remote agent quits.
|
|
|
|
|
|
|
|
The power of the monitor command is that it allows you to log the agent
|
|
|
|
at a relatively high log level (such as "warn"), but still access debug
|
|
|
|
logs and watch the debug logs if necessary.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2014-02-19 01:32:13 +00:00
|
|
|
Usage: `consul monitor [options]`
|
2014-02-08 00:41:03 +00:00
|
|
|
|
2017-02-09 22:31:52 +00:00
|
|
|
#### API Options
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
@include 'http_api_options_client.mdx'
|
2017-02-09 22:31:52 +00:00
|
|
|
|
|
|
|
#### Command Options
|
2014-02-08 00:41:03 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-log-level` - The log level of the messages to show. By default this
|
2014-02-08 00:41:03 +00:00
|
|
|
is "info". This log level can be more verbose than what the agent is
|
|
|
|
configured to run at. Available log levels are "trace", "debug", "info",
|
|
|
|
"warn", and "err".
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-log-json` - Toggles whether the messages are streamed in JSON format.
|
2020-01-28 23:50:41 +00:00
|
|
|
By default this is false.
|