Skip to content
Hoody.com

The Log Management API exposes five operations for working with the log files written by the exec service on a container: list the available files, read or stream their contents, search across them, and clear old entries. Every endpoint is scoped to a single container instance, addressed through the request URL, and requires an authenticated session.

Returns the log files available in the container’s logs directory. The result may be filtered by type and capped by limit.

NameInTypeRequiredDefaultDescription
typequerystringNo"all"Which logs to list. One of all, request, access, cron, other. Any other value is refused with 400.
limitquerystringNoMaximum number of files to return.
Terminal window
curl -X GET "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/logs/list?type=access&limit=50" \
-H "Authorization: Bearer $HOODY_TOKEN"
{
"logs": [
{
"name": "access/access.log",
"size": 4096
},
{
"name": "executions/exec-123/execution.log",
"size": 8192
}
],
"count": 2
}

The response may also include a directory field listing the top-level directory that was scanned.

Opens a server-sent event stream over a log file. With follow=true (the default), the connection stays open and new lines are delivered as they are written.

NameInTypeRequiredDefaultDescription
filequerystringYesName of the log file to stream, as returned by logs/list.
followquerybooleanNotrueKeep the stream open and send new lines as they are written. Accepts true/false/1/0.
Terminal window
curl -N -X GET "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/logs/stream?file=executions/exec-123/execution.log&follow=true" \
-H "Authorization: Bearer $HOODY_TOKEN"

The response is a text/event-stream body. Each event is a data: line carrying one log record, terminated by a blank line:

data: {"line": "2026-01-01 12:00:00 INFO Starting service"}
data: {"line": "2026-01-01 12:00:01 INFO Ready"}
event: gap
data: {"reason": "rotated_file_unavailable", "file": "execution.log.1"}
data: {"line": "2026-01-01 12:00:05 INFO Running task"}

Reads a log file or a specific file belonging to an execution and returns the lines, optionally filtered by a search term. Either file or executionId must be supplied.

NameTypeRequiredDefaultDescription
filestringConditionalLog file to read, as logs/list names it: a file at the top of the logs directory, access/access.log or cron/fires.log (or a rotated .<...> copy), or executions/<id>/<file>. With executionId, one of that execution’s files instead: execution.log, request.log, response.log, summary.json, metadata.json (default execution.log).
executionIdstringConditionalExecution whose log to read: 1 to 64 letters, digits, hyphens, or underscores. An empty string is the same as omitting it.
linesinteger | stringNo100Maximum number of lines to return, 1 to 10000. A string of digits in that range is also accepted.
tailbooleanNotrueIf true, return the most recent lines; otherwise return from the start.
searchstringNoIf set, only return lines that contain this substring.
Terminal window
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/logs/read" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"file": "executions/exec-123/execution.log",
"lines": 100,
"tail": true,
"search": "ERROR"
}'
{
"file": "executions/exec-123/execution.log",
"executionId": "exec-123",
"files": [
"executions/exec-123/execution.log",
"executions/exec-123/request.log"
],
"totalLines": 250,
"filteredLines": 12,
"returnedLines": 12,
"lines": [
"2026-01-01 12:00:00 INFO Starting task",
"2026-01-01 12:00:01 ERROR Connection refused"
],
"size": 4096,
"modified": "2026-01-01T12:00:01.000Z"
}

Searches log files for a literal string or a regular expression. At least one of query or regex must be supplied.

NameTypeRequiredDefaultDescription
querystringConditionalLiteral string to search for.
regexstringConditionalRegular expression to search for.
filesarray of stringNoList of file names to search within. When omitted, all available log files are searched.
limitintegerNo1000Maximum number of matches to return.
caseSensitivebooleanNofalseIf true, the match is case-sensitive.
Terminal window
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/logs/search" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "ERROR",
"limit": 100,
"caseSensitive": false
}'
{
"query": "ERROR",
"searchType": "literal",
"filesSearched": 5,
"matchesFound": 3,
"results": [
{
"file": "executions/exec-123/execution.log",
"line": 42,
"content": "2026-01-01 12:00:01 ERROR Connection refused"
}
]
}

Removes log files matching the supplied filters. The request must include the safety parameter confirm=true; otherwise the call is rejected with 400.

NameInTypeRequiredDescription
filequerystringNoDelete only this specific file.
typequerystringNoDelete only files of this type.
olderThanDaysquerystringNoDelete only files older than this many days (non-negative number).
confirmquerystringYesSafety confirmation; must be the literal true or the request is rejected with 400.
Terminal window
curl -X DELETE "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/logs/clear?olderThanDays=7&confirm=true" \
-H "Authorization: Bearer $HOODY_TOKEN"
{
"deleted": 15,
"totalSize": 1048576,
"skippedActive": 2,
"message": "Cleared 15 log files"
}