dt timestamp, level, message, and the full meta object — queryable in Live tail and with SQL.
Setup
- In Better Stack, create a source (platform: JavaScript / HTTP) and copy its source token. Newer sources also show a dedicated ingesting host.
- Set the environment variables:
- Wire the transport:
- Trigger a request and watch Live tail.
Environment Variables
Options
Plus the shared batching options:
maxBatchSize, flushIntervalMs, timeout, retries — see the overview.
Payload
Each log posts as one JSON object in a batched array:context.requestId or request.method in SQL and Live tail filters.
Troubleshooting
401— the source token is wrong, or the source was deleted; copy a fresh token from the source settings.- Logs land in the wrong source — each source has its own token; double-check which one is in the environment.
- Newer source, nothing arrives — sources with a dedicated ingesting host reject the legacy default endpoint; set
BETTER_STACK_INGESTING_HOST.