Skip to content

Machine ID: Support for JSON log formatting#30755

Merged
strideynet merged 3 commits intomasterfrom
strideynet/json-tbot-logging
Aug 21, 2023
Merged

Machine ID: Support for JSON log formatting#30755
strideynet merged 3 commits intomasterfrom
strideynet/json-tbot-logging

Conversation

@strideynet
Copy link
Copy Markdown
Contributor

Use --log-format json with tbot start, tbot init or tbot configure to have logs output in a structured JSON format.

Copy link
Copy Markdown
Contributor

@Tener Tener left a comment

Choose a reason for hiding this comment

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

Just minor comments.

Comment thread tool/tbot/main.go
Comment thread tool/tbot/main.go
| `--reader-user` | Enables POSIX ACLs and defines the Linux user that will read short-lived certificates from `--destination-dir`. |
| `--init-dir` | If using a config file and multiple destinations are configured, controls which destination dir to configure. |
| `--clean` | If set, remove unexpected files and directories from the destination. |
| `--log-format` | Controls the format of output logs. Can be `json` or `text`. Defaults to `text`. |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ptgott I think there was a project to auto-generate the CLI reference at some point. It would make it easier to maintain this part of the docs while potentially lowering the amount of the docs-review workload. What would be needed to make it a reality?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We haven't looked into auto-generating the CLI reference yet, but I imagine that we would need to:

  • Determine how to auto-generate the docs from the source (e.g., using the kingpin usage output).
  • Write a template for the auto-generated docs.
  • Ensure that all information in the existing docs exists in the source (i.e, so we don't lose anything from auto-generation). This might include adding contextual information to the template. I'm guessing that this step will be the most difficult.

@strideynet strideynet added this pull request to the merge queue Aug 21, 2023
Merged via the queue into master with commit 9268e97 Aug 21, 2023
@strideynet strideynet deleted the strideynet/json-tbot-logging branch August 21, 2023 13:50
@public-teleport-github-review-bot
Copy link
Copy Markdown

@strideynet See the table below for backport results.

Branch Result
branch/v13 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants