Skip to content

Agent Mesh

logging: default --log-format to text, own ring buffer, and set cfg.Level

Antonio Ojea241cf12f07f9
diff --git a/cmd/agentmesh-control-plane/main.go b/cmd/agentmesh-control-plane/main.go
index d9224fa9..fbf6e486 100644
--- a/cmd/agentmesh-control-plane/main.go
+++ b/cmd/agentmesh-control-plane/main.go
@@ -202,7 +202,7 @@ func main() {
rootCmd.Flags().StringVar(&stsIssuerURL, "sts-issuer-url", "", "Canonical external URL of this control plane for OIDC/STS issuer and discovery metadata (or env AGENTMESH_STS_ISSUER_URL)")
rootCmd.Flags().BoolVar(&insecureSkipTLSVerify, "insecure-skip-tls-verify", false, "Skip TLS verification for OIDC providers")
rootCmd.Flags().StringVar(&logLevel, "log-level", "info", "Log level (debug, info, warn, error)")
- rootCmd.Flags().StringVar(&logFormat, "log-format", "", "Log format (text, json); when unset, the LOG_FORMAT env var decides, else text")
+ rootCmd.Flags().StringVar(&logFormat, "log-format", "text", "Log format (text, json)")
rootCmd.Flags().BoolVar(&autoApproveEnrollment, "auto-approve-enrollment", false, "Auto-approve valid bootstrap token enrollment requests")
adminCmd := &cobra.Command{
diff --git a/cmd/agentmesh-node/main.go b/cmd/agentmesh-node/main.go
index 71505822..95a4f555 100644
--- a/cmd/agentmesh-node/main.go
+++ b/cmd/agentmesh-node/main.go
@@ -316,7 +316,7 @@ func main() {
return
}
// Duplicate logs to the ring buffer served by /debug/logs.
- logging.Setup(logging.Options{Level: logLevelFlag, Format: logFormatFlag, SinkURL: "ringbuffer://"})
+ logging.Setup(logging.Options{Level: logLevelFlag, Format: logFormatFlag, RingBuffer: true})
apiTokenFlag = resolveDaemonSecret("api-token", apiTokenPathFlag, "AGENTMESH_API_TOKEN")
bootstrapTokenFlag = resolveSecretFlag("bootstrap-token", bootstrapTokenFlag, bootstrapTokenPathFlag)
@@ -870,7 +870,7 @@ func main() {
runCmd.Flags().BoolVar(&enableRelayFlag, "enable-relay", false, "Allow this node to serve as a relay for others")
runCmd.Flags().BoolVar(&daemonizeFlag, "daemonize", false, "Run the node in the background and return once its local API answers (writes agentmesh-node.log and agentmesh-node.pid to the data directory, and generates an API token there if none is configured)")
runCmd.Flags().StringVar(&logLevelFlag, "log-level", "info", "Log level (debug, info, warn, error)")
- runCmd.Flags().StringVar(&logFormatFlag, "log-format", "", "Log format (text, json); when unset, the LOG_FORMAT env var decides, else text")
+ runCmd.Flags().StringVar(&logFormatFlag, "log-format", "text", "Log format (text, json)")
runCmd.Flags().DurationVar(&keyGracePeriodFlag, "key-grace-period", 24*time.Hour, "Key grace period for old keys (e.g. 24h)")
runCmd.Flags().BoolVar(&allowLoopbackFlag, "allow-loopback", false, "Allow publishing and connecting to loopback/link-local addresses")
runCmd.Flags().BoolVar(&announcePrivateFlag, "announce-private", true, "Publish this host's private (RFC1918/ULA) addresses to the mesh; keep enabled for LAN or on-premises meshes, disable when peers are only reachable through routers or public addresses")
diff --git a/cmd/agentmesh-one/main.go b/cmd/agentmesh-one/main.go
index 832e146c..5f049b2a 100644
--- a/cmd/agentmesh-one/main.go
+++ b/cmd/agentmesh-one/main.go
@@ -214,8 +214,8 @@ func main() {
rootCmd.Flags().StringVar(&workloadIssuer, "workload-issuer", "", "Optional workload OIDC issuer URL or '<issuer>=<email-suffix>' (comma-separated); accepted at /register, /refresh and /token/exchange, refused at /user/* and /oauth/authorize")
rootCmd.Flags().StringVar(&oidcClientID, "oidc-client-id", "", "OAuth client id advertised via /info (defaults to the first allowed audience)")
rootCmd.Flags().StringVar(&allowedAudiencesFlag, "allowed-audiences", api.DefaultAudience, "Comma-separated list of allowed OIDC audiences")
- rootCmd.Flags().StringVar(&logLevel, "log-level", "", "Log level: debug, info, warn, error")
- rootCmd.Flags().StringVar(&logFormat, "log-format", "", "Log format (text, json); when unset, the LOG_FORMAT env var decides, else text")
+ rootCmd.Flags().StringVar(&logLevel, "log-level", "info", "Log level (debug, info, warn, error)")
+ rootCmd.Flags().StringVar(&logFormat, "log-format", "text", "Log format (text, json)")
rootCmd.Flags().StringVar(&tunnelProvider, "tunnel", "", "Publish the listener on a public URL through a tunnel provider ("+strings.Join(tunnel.Names(), ", ")+"); sets the external URL")
rootCmd.Flags().StringVar(&tunnelTokenPath, "tunnel-token-path", "", "File containing the tunnel provider token (or env AGENTMESH_TUNNEL_TOKEN); use with --tunnel <provider> --external-url https://...")
rootCmd.Flags().BoolVar(&tunnelInstall, "tunnel-install", false, "Download the pinned connector binary (cloudflared "+tunnel.CloudflaredVersion+", digest-verified) into <data-dir>/bin without asking; implies accepting its license")
diff --git a/cmd/agentmesh-router/main.go b/cmd/agentmesh-router/main.go
index d80504d6..d5424051 100644
--- a/cmd/agentmesh-router/main.go
+++ b/cmd/agentmesh-router/main.go
@@ -145,7 +145,7 @@ func main() {
rootCmd.Flags().BoolVar(&allowLoopback, "allow-loopback", false, "Allow loopback and link-local addresses for discovery")
rootCmd.Flags().IntVar(&connsPerSourceIP, "conns-per-source-ip", 0, "Max inbound connections per source IP; 0 is a quarter of --high-watermark, so filling the router takes at least four addresses. Raise it where more members share one address")
rootCmd.Flags().StringVar(&logLevel, "log-level", "info", "Log level (debug, info, warn, error)")
- rootCmd.Flags().StringVar(&logFormat, "log-format", "", "Log format (text, json); when unset, the LOG_FORMAT env var decides, else text")
+ rootCmd.Flags().StringVar(&logFormat, "log-format", "text", "Log format (text, json)")
rootCmd.Flags().DurationVar(&dhtProviderAddrTTL, "dht-provider-addr-ttl", router.DefaultDHTProviderAddrTTL, "How long a DHT provider record lives after its last announcement")
rootCmd.Flags().DurationVar(&dhtMaxRecordAge, "dht-max-record-age", 0, "Maximum age for DHT records (0s uses library default)")
rootCmd.Flags().IntVar(&lowWaterMark, "low-watermark", 0, "Connections the router trims down to once it is over --high-watermark; 0 is 15% below the high watermark, so a trim sheds that share and no more")
diff --git a/internal/logging/logging.go b/internal/logging/logging.go
index 5d3c1029..99360bad 100644
--- a/internal/logging/logging.go
+++ b/internal/logging/logging.go
@@ -16,54 +16,81 @@
package logging
import (
- "os"
+ "container/ring"
+ "net/url"
+ "strings"
+ "sync"
golog "github.com/ipfs/go-log/v2"
+ "go.uber.org/zap"
)
var logger = golog.Logger("logging")
+const (
+ ringBufferScheme = "ringbuffer"
+ logBufferLines = 500
+ // maxLogLineBytes bounds each retained line so the ring's memory is
+ // bounded too (logBufferLines * maxLogLineBytes), whatever a remote peer
+ // manages to get logged.
+ maxLogLineBytes = 4 << 10
+)
+
+var (
+ ringBufferOnce sync.Once
+ ringBuffer *ringBufferSink
+)
+
// Options selects how a binary logs. Zero values keep the defaults: info
-// level, the LOG_FORMAT env var (else text) and no extra sink.
+// level, text format and no in-memory ring buffer.
type Options struct {
- Level string // log level: debug, info, warn or error
- Format string // output format: text or json; empty falls back to $LOG_FORMAT, else text
- SinkURL string // extra go-log sink, e.g. the node's ring buffer
+ Level string // log level: debug, info, warn or error (default: info)
+ Format string // output format: text or json (default: text)
+ RingBuffer bool // also retain the most recent lines in memory (see RecentLogs)
}
-// Setup applies opts process-wide. go-log reads its GOLOG_* env at package
-// init, before main runs, so the config is re-applied here through
-// SetupLogging.
+// Setup applies opts process-wide.
func Setup(opts Options) {
- lvl, levelErr := golog.LevelFromString(opts.Level)
- if levelErr != nil {
- lvl = golog.LevelInfo
- }
- format := opts.Format
- badFormat := format != "" && format != "text" && format != "json"
- if format == "" || badFormat {
- format = os.Getenv("LOG_FORMAT")
+ lvl := golog.LevelInfo
+ var levelErr error
+ if opts.Level != "" {
+ lvl, levelErr = golog.LevelFromString(opts.Level)
+ if levelErr != nil {
+ lvl = golog.LevelInfo
+ }
}
cfg := golog.GetConfig()
- if opts.SinkURL != "" {
- cfg.URL = opts.SinkURL
+ cfg.Level = lvl
+ if opts.RingBuffer {
+ ringBufferOnce.Do(func() {
+ ringBuffer = newRingBufferSink(logBufferLines)
+ _ = zap.RegisterSink(ringBufferScheme, func(*url.URL) (zap.Sink, error) {
+ return ringBuffer, nil
+ })
+ })
+ cfg.URL = ringBufferScheme + "://"
+ } else {
+ cfg.URL = ""
}
- switch format {
+ badFormat := false
+ switch opts.Format {
case "json":
cfg.Format = golog.JSONOutput
- case "text":
+ case "", "text":
+ cfg.Format = golog.PlaintextOutput
+ default:
+ badFormat = true
cfg.Format = golog.PlaintextOutput
}
golog.SetupLogging(cfg)
- golog.SetAllLoggers(lvl)
// go-log starts at error level, so warnings only show after SetAllLoggers.
if levelErr != nil {
logger.Warnf("invalid log level %q, using info", opts.Level)
}
if badFormat {
- logger.Warnf("invalid log format %q, want text or json; using LOG_FORMAT", opts.Format)
+ logger.Warnf("invalid log format %q, want text or json; using text", opts.Format)
}
// go-libp2p-kad-dht logs routine small-mesh conditions (empty routing
// table, no closer peers) at INFO/ERROR, the latter through a malformed
@@ -73,3 +100,51 @@ func Setup(opts Options) {
_ = golog.SetLogLevel("dht/RtRefreshManager", "fatal")
}
}
+
+// RecentLogs returns the most recent log lines captured when Options.RingBuffer
+// was enabled in Setup.
+func RecentLogs() []string {
+ if ringBuffer == nil {
+ return []string{}
+ }
+ return ringBuffer.lines()
+}
+
+type ringBufferSink struct {
+ mu sync.Mutex
+ buffer *ring.Ring
+}
+
+func newRingBufferSink(lines int) *ringBufferSink {
+ return &ringBufferSink{buffer: ring.New(lines)}
+}
+
+func (s *ringBufferSink) Write(p []byte) (int, error) {
+ s.mu.Lock()
+ defer s.mu.Unlock()
+
+ // zap writes complete log lines per Write call.
+ line := strings.TrimSuffix(string(p), "\n")
+ if len(line) > maxLogLineBytes {
+ line = line[:maxLogLineBytes] + "…[truncated]"
+ }
+ s.buffer.Value = line
+ s.buffer = s.buffer.Next()
+ return len(p), nil
+}
+
+func (s *ringBufferSink) Sync() error { return nil }
+func (s *ringBufferSink) Close() error { return nil }
+
+func (s *ringBufferSink) lines() []string {
+ s.mu.Lock()
+ defer s.mu.Unlock()
+
+ logs := []string{}
+ s.buffer.Do(func(p any) {
+ if p != nil {
+ logs = append(logs, p.(string))
+ }
+ })
+ return logs
+}
diff --git a/internal/logging/logging_test.go b/internal/logging/logging_test.go
index ff61abaa..51061a1e 100644
--- a/internal/logging/logging_test.go
+++ b/internal/logging/logging_test.go
@@ -15,6 +15,7 @@
package logging
import (
+ "strings"
"testing"
golog "github.com/ipfs/go-log/v2"
@@ -24,19 +25,17 @@ import (
func TestSetupFormat(t *testing.T) {
cases := []struct {
name string
- env string
flag string
want golog.LogFormat
}{
- {"env selects json", "json", "", golog.JSONOutput},
- {"env selects text", "text", "", golog.PlaintextOutput},
- {"flag wins over env", "json", "text", golog.PlaintextOutput},
- {"flag selects json", "", "json", golog.JSONOutput},
- {"invalid flag falls back to env", "json", "bogus", golog.JSONOutput},
+ {"json", "json", golog.JSONOutput},
+ {"empty defaults to text", "", golog.PlaintextOutput},
+ {"json again", "json", golog.JSONOutput},
+ {"invalid falls back to text", "bogus", golog.PlaintextOutput},
+ {"explicit text", "text", golog.PlaintextOutput},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
- t.Setenv("LOG_FORMAT", tc.env)
Setup(Options{Format: tc.flag})
if got := golog.GetConfig().Format; got != tc.want {
t.Errorf("format = %v, want %v", got, tc.want)
@@ -45,15 +44,6 @@ func TestSetupFormat(t *testing.T) {
}
}
-func TestSetupInvalidFormatKeepsCurrent(t *testing.T) {
- t.Setenv("LOG_FORMAT", "")
- Setup(Options{Format: "text"})
- Setup(Options{Format: "bogus"})
- if got := golog.GetConfig().Format; got != golog.PlaintextOutput {
- t.Errorf("format = %v, want %v (PlaintextOutput): an invalid value must keep the current format", got, golog.PlaintextOutput)
- }
-}
-
func TestSetupLevels(t *testing.T) {
dht := golog.Logger("dht")
app := golog.Logger("logging-test-app")
@@ -62,6 +52,11 @@ func TestSetupLevels(t *testing.T) {
if got := app.Desugar().Core().Enabled(zapcore.InfoLevel); !got {
t.Errorf("app Enabled(Info) = %v, want true after Setup(info)", got)
}
+ // A logger created after Setup must also inherit the configured level.
+ late := golog.Logger("logging-test-late")
+ if got := late.Desugar().Core().Enabled(zapcore.InfoLevel); !got {
+ t.Errorf("late logger Enabled(Info) = %v, want true after Setup(info)", got)
+ }
if got := dht.Desugar().Core().Enabled(zapcore.ErrorLevel); got {
t.Errorf("dht Enabled(Error) = %v, want false (suppressed) at info level", got)
}
@@ -82,3 +77,44 @@ func TestSetupInvalidLevelFallsBackToInfo(t *testing.T) {
t.Errorf("app Enabled(Debug) = %v, want false: invalid level must fall back to info, not debug", got)
}
}
+
+func TestSetupRingBuffer(t *testing.T) {
+ Setup(Options{Level: "info", RingBuffer: true})
+ golog.Logger("logging-test-ring").Infof("hello ring buffer")
+ lines := RecentLogs()
+ found := false
+ for _, line := range lines {
+ if strings.Contains(line, "hello ring buffer") {
+ found = true
+ break
+ }
+ }
+ if !found {
+ t.Errorf("RecentLogs() = %v, want line containing %q", lines, "hello ring buffer")
+ }
+}
+
+// The ring keeps whole lines; without a per-line cap a remote peer that gets
+// an 8 MiB string logged pins it in memory for 500 rounds.
+func TestRingBufferSinkCapsLineBytes(t *testing.T) {
+ sink := newRingBufferSink(4)
+ huge := strings.Repeat("A", 3*maxLogLineBytes) + "\n"
+ if _, err := sink.Write([]byte(huge)); err != nil {
+ t.Fatal(err)
+ }
+ _, _ = sink.Write([]byte("short\n"))
+
+ lines := sink.lines()
+ if len(lines) != 2 {
+ t.Fatalf("got %d lines, want 2", len(lines))
+ }
+ if got := len(lines[0]); got > maxLogLineBytes+len("…[truncated]") {
+ t.Errorf("stored line is %d bytes, want <= %d", got, maxLogLineBytes+len("…[truncated]"))
+ }
+ if !strings.HasSuffix(lines[0], "[truncated]") {
+ t.Errorf("truncated line should be marked, got suffix %q", lines[0][len(lines[0])-16:])
+ }
+ if lines[1] != "short" {
+ t.Errorf("second line = %q, want %q", lines[1], "short")
+ }
+}
diff --git a/internal/node/debug_handlers.go b/internal/node/debug_handlers.go
index 411c8728..5924c457 100644
--- a/internal/node/debug_handlers.go
+++ b/internal/node/debug_handlers.go
@@ -22,6 +22,7 @@ import (
"slices"
"time"
+ "github.com/google/agentmesh/internal/logging"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/multiformats/go-multiaddr"
)
@@ -68,7 +69,7 @@ func newDebugHandler(n *AgentMeshNode) http.Handler {
writeDebugJSON(w, n.tokenInfo())
})
mux.HandleFunc("GET /debug/logs", func(w http.ResponseWriter, r *http.Request) {
- writeDebugJSON(w, logsResponse{Logs: GetRecentLogs()})
+ writeDebugJSON(w, logsResponse{Logs: logging.RecentLogs()})
})
mux.HandleFunc("POST /debug/connect-peer", func(w http.ResponseWriter, r *http.Request) {
var req struct {
diff --git a/internal/node/log_buffer.go b/internal/node/log_buffer.go
index d873a67f..d1d87296 100644
--- a/internal/node/log_buffer.go
+++ b/internal/node/log_buffer.go
@@ -14,58 +14,11 @@
package node
-import (
- "container/ring"
- "fmt"
- "net/url"
- "strings"
- "sync"
+import "fmt"
- "go.uber.org/zap"
-)
-
-// RingBufferSink implements zap.Sink to capture logs in memory.
-type RingBufferSink struct {
- mu sync.Mutex
- buffer *ring.Ring
-}
-
-const (
- logBufferLines = 500
- // maxLogLineBytes bounds each retained line so the ring's memory is
- // bounded too (logBufferLines * maxLogLineBytes), whatever a remote peer
- // manages to get logged.
- maxLogLineBytes = 4 << 10
- // maxRemoteLogBytes is how much of a remote-controlled string a log
- // message may carry; see truncateForLog.
- maxRemoteLogBytes = 256
-)
-
-var globalLogBuffer = &RingBufferSink{
- buffer: ring.New(logBufferLines),
-}
-
-func init() {
- _ = zap.RegisterSink("ringbuffer", func(u *url.URL) (zap.Sink, error) {
- return globalLogBuffer, nil
- })
-}
-
-// Write implements io.Writer
-func (s *RingBufferSink) Write(p []byte) (n int, err error) {
- s.mu.Lock()
- defer s.mu.Unlock()
-
- // zap writes complete log lines per Write call
- line := strings.TrimSuffix(string(p), "\n")
- if len(line) > maxLogLineBytes {
- line = line[:maxLogLineBytes] + "…[truncated]"
- }
- s.buffer.Value = line
- s.buffer = s.buffer.Next()
-
- return len(p), nil
-}
+// maxRemoteLogBytes is how much of a remote-controlled string a log
+// message may carry; see truncateForLog.
+const maxRemoteLogBytes = 256
// truncateForLog bounds a string that a remote peer chose (a request path, a
// tool result, a target name) before it reaches the logs.
@@ -75,27 +28,3 @@ func truncateForLog(s string) string {
}
return fmt.Sprintf("%s…(+%d bytes)", s[:maxRemoteLogBytes], len(s)-maxRemoteLogBytes)
}
-
-// Sync implements zap.Sink
-func (s *RingBufferSink) Sync() error {
- return nil
-}
-
-// Close implements zap.Sink
-func (s *RingBufferSink) Close() error {
- return nil
-}
-
-// GetRecentLogs returns the most recent log lines.
-func GetRecentLogs() []string {
- globalLogBuffer.mu.Lock()
- defer globalLogBuffer.mu.Unlock()
-
- logs := []string{}
- globalLogBuffer.buffer.Do(func(p any) {
- if p != nil {
- logs = append(logs, p.(string))
- }
- })
- return logs
-}
diff --git a/internal/node/log_buffer_test.go b/internal/node/log_buffer_test.go
index 3cc3ecc4..0e7e6578 100644
--- a/internal/node/log_buffer_test.go
+++ b/internal/node/log_buffer_test.go
@@ -15,41 +15,10 @@
package node
import (
- "container/ring"
"strings"
"testing"
)
-// The ring keeps whole lines; without a per-line cap a remote peer that gets
-// an 8 MiB string logged pins it in memory for 500 rounds.
-func TestRingBufferSinkCapsLineBytes(t *testing.T) {
- sink := &RingBufferSink{buffer: ring.New(4)}
- huge := strings.Repeat("A", 3*maxLogLineBytes) + "\n"
- if _, err := sink.Write([]byte(huge)); err != nil {
- t.Fatal(err)
- }
- _, _ = sink.Write([]byte("short\n"))
-
- var lines []string
- sink.buffer.Do(func(p any) {
- if p != nil {
- lines = append(lines, p.(string))
- }
- })
- if len(lines) != 2 {
- t.Fatalf("got %d lines, want 2", len(lines))
- }
- if got := len(lines[0]); got > maxLogLineBytes+len("…[truncated]") {
- t.Errorf("stored line is %d bytes, want <= %d", got, maxLogLineBytes+len("…[truncated]"))
- }
- if !strings.HasSuffix(lines[0], "[truncated]") {
- t.Errorf("truncated line should be marked, got suffix %q", lines[0][len(lines[0])-16:])
- }
- if lines[1] != "short" {
- t.Errorf("second line = %q, want %q", lines[1], "short")
- }
-}
-
func TestTruncateForLog(t *testing.T) {
if got := truncateForLog("small"); got != "small" {
t.Errorf("short strings must pass through, got %q", got)
diff --git a/site/content/docs/reference/agentmesh-node.md b/site/content/docs/reference/agentmesh-node.md
index 82c5f167..e430990d 100644
--- a/site/content/docs/reference/agentmesh-node.md
+++ b/site/content/docs/reference/agentmesh-node.md
@@ -128,7 +128,7 @@ explains how to enroll.
| `--monitor-interval` | `1m` | How often the monitor checks that a router is connected. |
| `--autorelay-min-interval`, `--autorelay-boot-delay`, `--autorelay-backoff` | `30s`, `0s`, `3s` | libp2p AutoRelay tuning. |
| `--log-level` | `info` | `debug`, `info`, `warn` or `error`. |
-| `--log-format` | | `text` or `json`. When unset, the `LOG_FORMAT` env var decides, else `text`. |
+| `--log-format` | `text` | `text` or `json`. |
## `reset`
diff --git a/site/content/docs/reference/agentmesh-one.md b/site/content/docs/reference/agentmesh-one.md
index d6cc1694..8c2fb82b 100644
--- a/site/content/docs/reference/agentmesh-one.md
+++ b/site/content/docs/reference/agentmesh-one.md
@@ -49,7 +49,7 @@ downloaded tunnel connector.
| `--enroll-qr` | when stdout is a terminal | Print a device-enrollment QR code at startup. Only for `https` URLs. |
| `--enroll-qr-max-usages` | `1` | How many devices the startup QR admits. |
| `--log-level` | `info` | `debug`, `info`, `warn`, `error`. |
-| `--log-format` | | `text` or `json`. When unset, the `LOG_FORMAT` env var decides, else `text`. |
+| `--log-format` | `text` | `text` or `json`. |
### Embedded component tunables
diff --git a/site/content/docs/reference/control-plane.md b/site/content/docs/reference/control-plane.md
index ea073e5d..ef55ee3e 100644
--- a/site/content/docs/reference/control-plane.md
+++ b/site/content/docs/reference/control-plane.md
@@ -40,7 +40,7 @@ agentmesh-control-plane admin unban --peer <id> lift a ban
| `--node-retention` | `720h` (30 days) | How long the record of an enrolled node is kept after its session expires. Banned nodes are kept forever. `0` keeps every record. |
| `--mesh-reconnect-interval` | `30s` | How often the event publisher re-reads the router leases and dials any router it is not connected to. On each router it runs the mesh handshake with a credential it mints for its own peer under the signing key, with the role `mesh:role:control-plane`, so the router holds its connection as a member's. |
| `--log-level` | `info` | `debug`, `info`, `warn`, `error`. |
-| `--log-format` | | `text` or `json`. When unset, the `LOG_FORMAT` env var decides, else `text`. |
+| `--log-format` | `text` | `text` or `json`. |
## HTTP API
diff --git a/site/content/docs/reference/router.md b/site/content/docs/reference/router.md
index dd1cd9bf..46fbb663 100644
--- a/site/content/docs/reference/router.md
+++ b/site/content/docs/reference/router.md
@@ -53,7 +53,7 @@ replica count.
| `--metrics-addr` | off | Serve `/metrics`, `/healthz`, `/readyz` and `/debug/peer` without authentication on this address. `/readyz` returns `200` once the router is enrolled and the libp2p host is up. Keep this address separate from the libp2p ports and inside the cluster. |
| `--pprof-addr` | off | Serve Go runtime profiles under `/debug/pprof/` on this address, for attributing memory or goroutines the metrics show as held. Unauthenticated, and a heap profile is a dump of process memory, which holds the router's key: bind it to loopback and reach it with `kubectl port-forward`. |
| `--log-level` | `info` | `debug`, `info`, `warn`, `error`. |
-| `--log-format` | | `text` or `json`. When unset, the `LOG_FORMAT` env var decides, else `text`. |
+| `--log-format` | `text` | `text` or `json`. |
## What it does at run time