Logyak

Setup guide

HTTP API

Send logs from anything that can make an HTTP request: servers, scripts, cron jobs, workers.

Send a line

Add an HTTP / Node.js source and use its token as a bearer key. One request can carry one JSON object, a JSON array, NDJSON (one object per line) or plain text (one line per entry), up to 5,000 lines and 1,024 KB.

curl
curl -X POST https://logyak.com/api/v1/logs \
  -H "Authorization: Bearer $LOGYAK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"level":"error","service":"api","message":"Payment failed","order_id":42}'

The answer is 202 with how many lines were stored (accepted), refused because the month's allowance is used up (dropped) or could not be read (skipped).

Fields Logyak understands

FieldTypeDescription
message (or msg, text, log)requiredstringThe line itself. Without one, an HTTP line is written from its method, path and status, or the whole object is kept as JSON.
level (or severity)string | numbertrace, debug, info, warn, error, fatal, or a pino number. Without one it is read from the words and the HTTP status.
timestamp (or ts, time)string | numberISO 8601, or epoch seconds, milliseconds or microseconds. Without one, the time it arrived.
service (or app)stringWhich part of your system wrote it. Search with service:name.
hoststringThe machine or domain.
request_id (or requestId)stringFollow one request across services with request:id.
http.method, http.path, http.status, http.duration_msobjectOr the same names flat (method, path, status, duration_ms). Makes the line an HTTP line.

Anything else is kept as attributes and searchable with attr.name:value. A message is cut at 16 KB, attributes at 8 KB.

Errors

FieldTypeDescription
401UnauthorizedThe token is missing, wrong, or belongs to another kind of source.
413Payload too largeMore lines or bytes than one batch allows. Send smaller batches.
429Too many requestsMore requests a minute than a source may send. Batch lines together.
503UnavailableThe lines could not be stored just now. Send the same batch again shortly.