diff --git a/command/agent/monitor/monitor_test.go b/command/agent/monitor/monitor_test.go index 92a8563cc2f..f422171c19b 100644 --- a/command/agent/monitor/monitor_test.go +++ b/command/agent/monitor/monitor_test.go @@ -82,7 +82,7 @@ TEST: select { case <-passed: break TEST - case <-time.After(2 * time.Second): + case <-time.After(3 * time.Second): require.Fail(t, "expected to see warn dropped messages") } } diff --git a/command/agent_monitor.go b/command/agent_monitor.go index 3fc86d48cd7..b5ef2c28cd7 100644 --- a/command/agent_monitor.go +++ b/command/agent_monitor.go @@ -22,8 +22,7 @@ func (c *MonitorCommand) Help() string { helpText := ` Usage: nomad monitor [options] - Shows recent log messages of a nomad agent, and attaches to the agent, - outputting log messagse as they occur in real time. The monitor lets you + Stream log messages of a nomad agent. The monitor command lets you listen for log levels that may be filtered out of the Nomad agent. For example your agent may only be logging at INFO level, but with the monitor command you can set -log-level DEBUG @@ -47,7 +46,7 @@ Monitor Specific Options: } func (c *MonitorCommand) Synopsis() string { - return "stream logs from a nomad agent" + return "stream logs from a Nomad agent" } func (c *MonitorCommand) Name() string { return "monitor" } @@ -68,7 +67,7 @@ func (c *MonitorCommand) Run(args []string) int { flags.Usage = func() { c.Ui.Output(c.Help()) } flags.StringVar(&logLevel, "log-level", "", "") flags.StringVar(&nodeID, "node-id", "", "") - flags.BoolVar(&logJSON, "log-json", false, "") + flags.BoolVar(&logJSON, "json", false, "") if err := flags.Parse(args); err != nil { return 1 diff --git a/nomad/client_agent_endpoint.go b/nomad/client_agent_endpoint.go index d3d3d4d5508..6c66c22338c 100644 --- a/nomad/client_agent_endpoint.go +++ b/nomad/client_agent_endpoint.go @@ -41,7 +41,7 @@ func (m *Agent) monitor(conn io.ReadWriteCloser) { return } - // Check node read permissions + // Check agent read permissions if aclObj, err := m.srv.ResolveToken(args.AuthToken); err != nil { handleStreamResultError(err, nil, encoder) return @@ -146,7 +146,6 @@ func (m *Agent) monitor(conn io.ReadWriteCloser) { var buf bytes.Buffer frameCodec := codec.NewEncoder(&buf, structs.JsonHandle) - // framer := sframer.NewStreamFramer(frames, 1*time.Second, 200*time.Millisecond, 64*1024) framer := sframer.NewStreamFramer(frames, 1*time.Second, 200*time.Millisecond, 1024) framer.Run() defer framer.Destroy()