Here are some common usage examples for the Logging API.
Prerequisites:
-
DC/OS CLI must be installed, configured, and logged in.
-
Extract
DCOS_URL
andDCOS_AUTH_TOKEN
from the DC/OS CLI:
Node Logs
Get the last 100 journal entries from a single node:
Component Logs
Get the last 100 journal entries from a single component service:
Leading Mesos Master:
Leading Marathon:
Agent DNS Forwarder (Spartan):
Container Logs
Get the last 100 journal entries from a single service container:
Tail
Get the last 10 journal entries and follow new events:
Range
Skip 100 entries from the beginning of the journal and return the next 10 entries:
Plain Text
Skip 200 entries from the beginning of the journal and return the next entry in plain text:
JSON
Skip 200 entries from the beginning of the journal and return the next entry in JSON:
Event Stream
Skip 200 entries from the beginning of the journal and return the next entry as an event stream:
Event Stream Cursor
Get all journal entries after a specific cursor and stream new entries:
The cursor must be URL encoded.
Range Cursor
Get 1,000 journal entries, 100 at a time:
Each call uses the cursor of the last entry from the previous call. The cursor must be URL encoded.