Skip to content

Read a website's error logs

GET /api/v2/shared-hosting/{accountId}/logs/error-log

Read the newest lines of a website’s error logs on a web hosting account. The call searches the website’s folder for error_log and *.log files and reads the five most recently written. It also reads the account’s PHP error log in logs/, filtered to the lines about this website. webServer holds the web server’s own lines for the website, such as a refused file or a served 503 page. Passwords, keys and tokens in the log files are redacted. When no log is found and the web server has no lines for the website, the call returns 404 not_found. The account must be active and on cPanel.

Authentication: An API key with the scopes read:hosting and console:services. About keys and scopes

Request

Path parameters

accountIdstringrequired
The web hosting account ID (acct_…).

Query parameters

domainstring
A domain on the account. Default: the account’s main domain.
linesinteger
How many of the newest lines to return from each log, 1 to 500. Default 100. Default 100. 1 to 500.

Example

GET /api/v2/shared-hosting/{accountId}/logs/error-log
curl "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/logs/error-log" \
-H "Authorization: Bearer $HOSTUP_API_KEY"

Responses

200 The newest lines of each log found, plus the web server’s lines for the website. When only the web server has lines, logs is empty and source is null.

Response 200
{
"source": {
"path": "public_html/error_log",
"domain": "example.com"
},
"truncated": false,
"entries": [
"[10-Jul-2026 08:14:22 UTC] PHP Fatal error: Uncaught Error: Call to undefined function example_function() in /home/abcde/public_html/wp-content/plugins/example-plugin/example.php:12"
],
"logs": [
{
"path": "public_html/error_log",
"modifiedAt": "2026-07-10T08:14:22.000Z",
"entries": [
"[10-Jul-2026 08:14:22 UTC] PHP Fatal error: Uncaught Error: Call to undefined function example_function() in /home/abcde/public_html/wp-content/plugins/example-plugin/example.php:12"
],
"truncated": false
}
],
"unreadablePaths": [],
"complete": true,
"logFilesFound": 1,
"searchLimited": false,
"webServer": {
"vhost": "example.com",
"entries": [
"2026-07-10 08:14:22.203662 [INFO] [example.com] File not found [~/public_html/503.shtml] "
],
"truncated": false
}
}
Response fields
sourceobject | null
The most recently written log. Null when only webServer has lines.
pathstring
Path of the log, relative to the account’s home folder.
domainstring
The domain the logs were read for.
truncatedboolean
True when the newest log has more lines than were returned.
entriesarray of string
The newest log’s lines, oldest first. Same as logs[0].entries.
logsarray of object
Every log that was read, most recently written first.
pathstring
Path of the log, relative to the account’s home folder.
modifiedAtstring
When the log was last written.
entriesarray of string
The log’s newest lines, oldest first.
truncatedboolean
True when the log has more lines than were returned.
accountLogobject
Set on the account’s PHP error log in logs/, which is filtered to this website.
siteEntriesinteger
Entries in the file that mention this website’s folder.
totalEntriesinteger
Entries in the file in total.
foreignHomePathsarray of object
Home folders other than this account’s that the log mentions, for example paths kept from a site copied in from another host. At most three.
homestring
The other home folder.
linesinteger
How many lines mention it.
unreadablePathsarray of string
Logs that were found but could not be read.
completeboolean
False when a log that was found could not be read.
logFilesFoundinteger
How many log files the search found. Only the five most recently written are read.
searchLimitedboolean
True when the search stopped early. More logs may exist deeper in the website’s folder.
webServerobject | null
The web server’s recent lines for this website, newest first. Null when they could not be read. A served 503 shows as a lookup of 503.shtml. A refused file shows as <path>: access is denied. Visitor addresses are removed. Paths start with ~/ for the home folder.
vhoststring
The website’s host name on the web server.
entriesarray of string
The lines, newest first. At most 80.
truncatedboolean
True when there were more than 80 lines.

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403The key lacks a scope or the account is not active. domain_not_owned: the domain is not on this account.
404No log file was found and the web server had no lines for the website (not_found). Errors may be logged elsewhere, for example in the application’s database.
409The account is not on cPanel (account_not_eligible_cpanel).
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.
502The account’s domains or the website’s log files could not be read right now (upstream_failed).