The logging endpoint for the Storyscript Cloud.
Once a connection has been established to the endpoint, the client must authenticate itself within 10 seconds. If this an authentication message is not received, the connection will be closed.
The authentication payload should look like the following:
{
"command": "auth",
"access_token": "your access token",
"app_id": "your app id",
"id": "your id (corresponds to owner_uuid)"
}
Once this message is received, the server will authenticate and authorise your connection. After a successful authorisation, the following message is sent:
{
"authorised": true
}
If authorisation fails, the connection will be terminated immediately.
In order for the server to reliably know that the client is connected,
a ping request must be at least once in 30 seconds. The recommended interval
is 25 seconds.
The payload looks like:
{
"command": "ping"
}
After a the authentication message is confirmed, a request for logs may be sent.
To retrieve logs from the runtime (Storyscript runtime), send the following message:
{
"command": "filter",
"source": "runtime",
"level": "debug/info/warn/error",
"n": 100,
"watch": true
}
n indicates how many lines before the current moment
must be sent (equivalent to tail -n)watch indicates that in addition to sending the last n lines of logs,
continue sending out logs in real timeTo retrieve logs that belong to a service, the following payload may be sent:
{
"command": "filter",
"source": "service",
"service_name": "redis",
"level": "debug/info/warn/error",
"n": 100,
"watch": true
}
level is currently ignoredn and watch have the same meaning as previously statedservice_name is the name of the service (either an alias such as redis,
or fully qualified such as your_name/service)More than one filter commands may be sent, which will result in multiple log messages being received.
Content type
Image
Digest
Size
295.1 MB
Last updated
about 7 years ago
docker pull asyncy/logstreamer