tailscale/logtail
James Scott 94fbb03352
logtail: add stateless generic UploadLogs (#20005)
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>
2026-06-15 13:27:49 -07:00
..
example all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
filch logtail/filch: fix filch test panic (#18660) 2026-02-10 13:24:00 -08:00
.gitignore Move Linux client & common packages into a public repo. 2020-02-09 09:32:57 -08:00
api.md Switch logging service from log.tailscale.io to log.tailscale.com (#14398) 2024-12-16 14:53:34 -08:00
buffer.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
config.go logtail: add Config.Disabled to suppress the startup banner 2026-04-20 13:33:10 -07:00
logtail_omit.go logtail: add stateless generic UploadLogs (#20005) 2026-06-15 13:27:49 -07:00
logtail_test.go logtail: add stateless generic UploadLogs (#20005) 2026-06-15 13:27:49 -07:00
logtail.go logtail: add stateless generic UploadLogs (#20005) 2026-06-15 13:27:49 -07:00
README.md Move Linux client & common packages into a public repo. 2020-02-09 09:32:57 -08:00

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.