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

✨ Add option for json log format to OCM Status Add-On ctlr+agent #62

Merged
merged 1 commit into from
May 22, 2024

Conversation

MikeSpreitzer
Copy link
Contributor

Summary

This PR extends the set of log formats available from just "text" to also include "json".

Related issue(s)

Fixes #

@MikeSpreitzer
Copy link
Contributor Author

After this change:

mspreitz@mjs13 ocm-status-addon % go run ./cmd/ocm-status-addon controller -h
Start the addon controller

Usage:
  addon controller [flags]

Flags:
      --component-namespace string   Namespace of the component.
      --enable-leader-election       Enables the leader election for the controller
  -h, --help                         help for controller
      --kubeconfig string            Location of the master configuration file to run from.

Global Flags:
      --log-flush-frequency duration         Maximum number of seconds between log flushes (default 5s)
      --log-json-info-buffer-size quantity   [Alpha] In JSON format with split output streams, the info messages can be buffered for a while to increase performance. The default value of zero bytes disables buffering. The size can be specified as number of bytes (512), multiples of 1000 (1K), multiples of 1024 (2Ki), or powers of those (3M, 4G, 5Mi, 6Gi). Enable the LoggingAlphaOptions feature gate to use this.
      --log-json-split-stream                [Alpha] In JSON format, write error messages to stderr and info messages to stdout. The default is to write a single stream to stdout. Enable the LoggingAlphaOptions feature gate to use this.
      --logging-format string                Sets the log format. Permitted formats: "json" (gated by LoggingBetaOptions), "text". (default "text")
  -v, --v Level                              number for the log level verbosity
      --vmodule pattern=N,...                comma-separated list of pattern=N settings for file-filtered logging (only works for text log format)

Before this change, the json stuff was not there.

@MikeSpreitzer MikeSpreitzer merged commit 1c1ffea into kubestellar:main May 22, 2024
6 checks passed
@MikeSpreitzer MikeSpreitzer deleted the json-too branch May 22, 2024 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants