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

DOCS-3366: Deduplicate noisy logs #3860

Merged
merged 3 commits into from
Jan 22, 2025
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
4 changes: 4 additions & 0 deletions docs/manage/troubleshoot/troubleshoot.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ For example:

For more information on setting log levels see, [Logging](/manage/troubleshoot/troubleshoot/#check-logs).

You may also find that not all logs you are expecting are displayed.
By default, `viam-server` deduplicates log messages that are deemed noisy.
To disable this behavior, see [Disable log deduplication](/operate/reference/viam-server/).

To access logs from the commandline, use [`viam machines logs`](/dev/tools/cli/#machines-alias-robots) on the command line or the [Machines API](/dev/reference/apis/robot/).

## Remote shell on the machine
Expand Down
56 changes: 56 additions & 0 deletions docs/operate/reference/viam-server/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,62 @@ Patterns are processed from top to bottom.
If multiple patterns apply, the last pattern to be processed will apply.
If log configurations are applied at a resource level using the `log_configuration` field, these take precedence over log levels applied in the `log` field of the machine configuration.

{{% expand "Click to view full configuration example" %}}

```json {class="line-numbers linkable-line-numbers" data-line="10-18"}
{
"components": [
{
"name": "camera1",
"type": "camera",
"model": "fake"
}
],
"services": [],
"log": [
{
"pattern": "rdk.resource_manager",
"level": "info"
},
{
"pattern": "rdk.resource_manager.*",
"level": "debug"
}
]
}
```

{{% /expand%}}

#### Disable log deduplication

By default, `viam-server` deduplicates log messages that are deemed noisy.
A log is deemed noisy if it has been output 3 times in the past 10 seconds.

To disable log deduplication, set `disable_log_deduplication` in your machine's configuration:

```json
"disable_log_deduplication": true
```

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure where I would put this within the nested JSON just from looking at this-- maybe expand example?

{{% expand "Click to view full configuration example" %}}

```json {class="line-numbers linkable-line-numbers" data-line="10"}
{
"components": [
{
"name": "camera1",
"type": "camera",
"model": "fake"
}
],
"services": [],
"disable_log_deduplication": true
}
```

{{% /expand%}}

#### Debugging

You can enable debug level logs in two ways:
Expand Down
Loading