Skip to main content

Logs

Overview

Logs can be accessed from the web UI or through setip.io API end point.

Logs are a handy feature since they let you keep track of all DNS and Proxy activity. You can also add your app activity to the logs since you can post to the Logs from the setip.io API so you are able to view your app logs along related network components activity. This can save you time when debugging your app.

Logs view from the UI

Logs are accessible from the Logs tab.

Log View

Refresh your logs by clicking on the "Refresh" button accessible at the top of the log result component, under the Log tab.

Refresh button

You can search the logs on the server first by adding a search term in the "Server filter" box: Refresh button

Searching logs on the filter first will return only the lines matching the search. This option is often faster but you will miss the log lines that maybe between the lines containing the search terms.

The server search box supports the following options:

  • Add the - character before a word to exclude it from the search, as in -DNS which will return all log lines not containing the word DNS.
  • Add multiple search terms separated by space or any punctuation to search for log lines with any of the search terms (PROXY DNS in the search box will lead to any log lines containing any of the words searched: PROXY or DNS).

To search the result returned by the server locally: enter the search term under the "search" box at the top of the log result component on the screen.

You can resize the log viewer by dragging its sides and switch to full screen mode by clicking on the full screen icon on the top right of the log lines (Only on desktops).

Logs retrieval from the API

API Spec: Logs retrieval from the API

GET /api/log (Fetch log entries)
URL Parameters
nametypedata typedescription
maxoptionalintegerLimit the number of log lines returned with the max=[max_number_here] query parameter, so max=4000 will returned the last 4000 lines of logs.
pwdrequiredstringthis is your domain name (yourproject.wg0.io)
krequiredstringYour log API key
searchoptionalstringAn optional search term
onlyoptionalstringOnly search for your app related log lines, add the only parameter with the value you used when posting to logs associated with your app (read paragraph below to learn how to post your own app logs)
Responses
http codecontent-typeresponse
200text/plain;charset=UTF-8Log lines if any]
403application/json{}
Example cURL
 curl "https://setip.io/api/log?pwd=yourproject.wg0.io&k=dssdc&search&max=200"

Adding to the logs

To post a log entry of your own to your logs: Use the following POST command to the https://setip.io/api endpoint: /logs.

Since your own apps log lines are displayed within the system services log lines it then becomes much easier to trace activity end to end and proceed to full introspection including over the network.

API Spec: Using the API to add to the Logs

POST /api/log (Adds searchable log entry)

Parameter

nametypedata typedescription
keyrequiredstringThis is your API Key
payloadrequiredJSONsee "JSON Value for "payload" parameter" below

JSON fields for the "payload" value

The json to post is as follow:

{
"key": "[log key accessible under the Keys tab]",
"pwd": "[The domain you wish to log to]",
"payload":
{
"message": "[any string to be searched by later]",
"meta": {
"[anyname]":"[anyvalue]",
},
"profile": "YOUR_APP_SHORT_CODE"
}
}
nametypedata typedescription
pwdrequiredstringThis is your domain name such as yourproject.wg0.io
messagerequiredstringThe message you want to log
profilerequiredstringThe profile is any string of character that we recommend you keep short and in upper case so it's easy to find out what app the log line originates from, this will display where you see PROXY and DNS on your PoC log lines
metaoptionalobject (JSON)You can add a meta json value to the log entry to contain a valid json entry of any kind. This can be handy when tracing your code as you will be able to use any of these values in the future to process your logs accordingly

Responses

http codecontent-typeresponse
201text/plain;charset=UTF-8Log created successfully
400application/json{"code":"400","message":"Bad Request"}

Example cURL

 curl -X "POST" "https://setip.io/api/log?pwd=YOUR_DOMAIN_NAME_HERE&> k=YOUR_LOG_KEY_HERE&search&max=200" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"payload": {
"message": "This text will display in the logs as the log line entry",
"meta": {
"nynewobject": {
"newobjectownfield": "atextvaluefornewobjectownfield"
},
"mynewfield": "avalueformynewfield"
}
}
}'