sls stands for Simple Logging Service. It’s a server with an API that
aggregates and tails log information and routinely backs up logs to a storage
"any content at all",
"separated into elements",
"in a json array",
sls takes logs from the request body and appends them to a single file stored
locally on disk allowing for quick local searches with something like
ripgrep. It’s important to have enough HDD space for those logfiles. sls can
sync changes to that file periodically offsite to a cloud storage system, like
a Google Cloud bucket and clear out local logfiles after a set period of time
Ordering: it’s assumed that logs batched together in a single API call are
from the same request or are related to the same action. Multiple requests
(e.g. logs from several different HTTP requests) can be included in a single
API call, but to ensure proper ordering, do not split up a request across API
calls. A simple buffer that flushes to the API is not sufficient if ordering
needs to be preserved.
Timestamps: sls does not add timestamps to the logs. If needed, servers
doing the logging should include them.
Auth: sls checks the provided X-API-Key header to make sure it matches the
API_KEY provided in the configuration file.
GET /log will tail the logs out as they’re received by sls and processed,
so you’ll see: