mirror of
https://github.com/tailscale/tailscale.git
synced 2026-06-23 15:31:47 -04:00
Add UploadLogs, a stateless alternative to NewLogger for callers that want to push a batch of log entries without the background uploader, ring buffer, stderr echoing, or network-up gating that a Logger provides. Entries are encoded, batched up to the server's maximum upload size, and POSTed synchronously; unlike Logger it does not retry. The Logger construction is split into a new unexported newLogger so the connection/encode/upload machinery is shared without starting the background goroutine. Log entries are modeled as a generic LogEntry[T] whose Value is inlined (via go-json-experiment) alongside the reserved "logtail" metadata member. T may be a struct (or pointer), a map with a string key, or a jsontext.Value; use jsontext.Value to mix differently-shaped payloads in a single upload. UploadLogs fills in client_time/proc_id/proc_seq from the Config where the caller leaves them zero. Updates tailscale/corp#40908 Change-Id: Idbf23cd0eb8233082fbdb9abed0f6f153b9225ba Signed-off-by: James Scott <jim@tailscale.com>
Tailscale Logs Service
This github repository contains libraries, documentation, and examples for working with the public API of the tailscale logs service.
For a very quick introduction to the core features, read the API docs and peruse the logs reprocessing example.
For more information, write to info@tailscale.io.