github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/website/pages/docs/commands/monitor.mdx (about) 1 --- 2 layout: docs 3 page_title: 'Commands: monitor' 4 sidebar_title: monitor 5 description: | 6 Stream the logs of a running nomad agent. 7 --- 8 9 # Command: monitor 10 11 The `nomad monitor` command streams log messages for a given agent. 12 13 ## Usage 14 15 ```plaintext 16 nomad monitor [options] 17 ``` 18 19 The nomad monitor command can be used to stream the logs of a 20 running Nomad agent. Monitor will follow logs and exit when 21 interrupted or until the remote agent quits. 22 23 The power of the monitor command is that it allows you to log 24 the agent at a relatively high log level (such as "warn"), 25 but still access debug logs and watch the debug logs if necessary. 26 The monitor command also allows you to specify a single client node id to follow. 27 28 ## General Options 29 30 @include 'general_options.mdx' 31 32 ## Monitor Options 33 34 - `-log-level`: The log level to use for log streaming. Defaults to `info`. 35 Possible values include `trace`, `debug`, `info`, `warn`, `error` 36 37 - `-node-id`: Specifies the client node-id to stream logs from. If no 38 node-id is given the nomad server from the -address flag will be used. 39 40 - `-server-id`: Specifies the nomad server id to stream logs from. Accepts 41 server names from `nomad server members` and also a special `leader` option 42 which will target the current leader. 43 44 - `-json`: Stream logs in json format 45 46 ## Examples 47 48 ```shell-sessionnomad monitor -log-level=DEBUG -node-id=a57b2adb-1a30-2dda-8df0-25abb0881952 49 2019-11-04T12:22:08.528-0500 [DEBUG] http: request complete: method=GET path=/v1/agent/health?type=server duration=1.445739ms 50 2019-11-04T12:22:09.892-0500 [DEBUG] nomad: memberlist: Stream connection from=127.0.0.1:53628 51 52 $ nomad monitor -log-level=DEBUG -json=true 53 {"@level":"debug","@message":"request complete"...} 54 55 ```