Skip to content

New CLI command to collect diagnostic logs in one step #3412

@rina23q

Description

@rina23q

Is your feature request related to a problem? Please describe.
Introduce a new CLI command to collect all the diagnostic logs in one step so that we can support users to report bugs or questions easily.

Describe the solution you'd like

The first idea is to create a new CLI subcommand tedge logs.

tedge logs [--output-dir <DIR>]

It collects

  • output of mqtt-logger (need to mask JWT token values) refer to comment
  • operation logs under /var/log/tedge/agent/*
  • message cache /etc/tedge/.tedge-mapper-c8y/entity_store.json Contents of the entity store, GET by HTTP API call. (tedge http get /tedge/entity-store/v1/entities)
  • tedge-mapper and tedge-agent logs (journalctl. how to do if the device is not using systemd)
  • mosquitto log (if using mosquitto)
  • and more?

and zips them, then outputs to the target directory.

Describe alternatives you've considered

Alternatively we can create a community plugin to collect logs.

Additional context

A good reference of the type of logs is what we collect in our system tests.
https://github.com/thin-edge/thin-edge.io/blob/main/tests/RobotFramework/libraries/ThinEdgeIO/ThinEdgeIO.py#L162

Metadata

Metadata

Assignees

Labels

ideaideas/opportunities/feature requests which need to be further investigated before implementation

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions