Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command/debug: capture more logs by default #23850

Merged
merged 3 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/23850.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
cli: Increase default log level and duration when capturing logs with `operator debug`
```
8 changes: 4 additions & 4 deletions command/operator_debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Debug Options:

-duration=<duration>
Set the duration of the debug capture. Logs will be captured from specified servers and
nodes at "log-level". Defaults to 2m.
nodes at "log-level". Defaults to 5m.

-event-index=<index>
Specifies the index to start streaming events from. If the requested index is
Expand All @@ -177,7 +177,7 @@ Debug Options:
duration to capture a single snapshot. Defaults to 30s.

-log-level=<level>
The log level to monitor. Defaults to DEBUG.
The log level to monitor. Defaults to TRACE.

-log-include-location
Include file and line information in each log line monitored. The default
Expand Down Expand Up @@ -359,11 +359,11 @@ func (c *OperatorDebugCommand) Run(args []string) int {
var nodeIDs, serverIDs string
var allowStale bool

flags.StringVar(&duration, "duration", "2m", "")
flags.StringVar(&duration, "duration", "5m", "")
flags.Int64Var(&eventIndex, "event-index", 0, "")
flags.StringVar(&eventTopic, "event-topic", "none", "")
flags.StringVar(&interval, "interval", "30s", "")
flags.StringVar(&c.logLevel, "log-level", "DEBUG", "")
flags.StringVar(&c.logLevel, "log-level", "TRACE", "")
flags.BoolVar(&c.logIncludeLocation, "log-include-location", true, "")
flags.IntVar(&c.maxNodes, "max-nodes", 10, "")
flags.StringVar(&c.nodeClass, "node-class", "", "")
Expand Down
6 changes: 3 additions & 3 deletions website/content/docs/commands/operator/debug.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ true.

## Debug Options

- `-duration=2m`: Set the duration of the debug capture. Logs will be captured from
specified servers and nodes at `log-level`. Defaults to `2m`.
- `-duration=5m`: Set the duration of the debug capture. Logs will be captured from
specified servers and nodes at `log-level`. Defaults to `5m`.

- `-interval=30s`: The interval between snapshots of the Nomad state.
If unspecified, only one snapshot is captured. Defaults to `30s`.

- `-log-level=DEBUG`: The log level to monitor. Defaults to `DEBUG`.
- `-log-level=TRACE`: The log level to monitor. Defaults to `TRACE`.

- `-log-include-location`: Include file and line information in each log line
monitored. The default is `true`.
Expand Down