---
title: "Return PHP error log for a domain"
method: GET
path: "/LogManager/view_error_log"
tags: ["LogManager", "Logs"]
---

# Return PHP error log for a domain

`GET /LogManager/view_error_log`

This function reads the trailing lines of a single PHP error log
file for a domain owned by the current cPanel user and returns
them in chronological order (oldest first).

## Query parameters

- `domain` string, required
- `file_id` 'php_fpm_error_log' | 'docroot_error_log' | 'homedir_error_log', required
- `limit` integer

## Response `200`

HTTP Request was successful.

- object
  - `apiversion` integer — The version of the API.
  - `func` string — The name of the method called.
  - `module` string — The name of the module called.
  - `result` object
    - `data` object — An object describing the requested log file and its content.
      - `file_id` 'php_fpm_error_log' | 'docroot_error_log' | 'homedir_error_log' — The identifier of the log file that was read. Same value as the `file_id` input parameter. * `php_fpm_error_log` — The PHP FPM error log. This file is located in the `logs/` directory within the cPanel account's home directory. * `docroot_error_log` — The PHP error log. This file is located in the domain's document root directory. * `homedir_error_log` — The cPanel account PHP error log. This file is located in the cPanel account's home directory.
      - `log_content` string[] — The end of the error log file in chronological order. **Note:** This array will return an empty value if the log file is empty.
      - `lines_read` integer — The number of lines returned in the `log_content` return's value.
      - `modified_today` 1 | 0 — Whether the log file was modified today. The function determines the time and date with the cPanel & WHM server's time. * `1` — The file was modified today. * `0` — The file was not modified today.
      - `mtime` integer — The log file's last-modified time, in Unix time format. **Note:** This return value is determined via a `fstat` system call on the log file.
      - `partial` 1 | 0 — Whether the log file contains more lines than the `limit` parameter's value. * `1` — The file exceeds the `limit` parameter's value. * `0` — The file did not exceed the `limit` parameter's value.
      - `path` string — The absolute path to the log file on disk.
      - `size` integer — The log file's size, in bytes. **Note:** This return value is determined via a `fstat` system call on the log file.
    - `errors` string[], nullable — List of errors if the API failed.
    - `messages` string[], nullable — List of messages generated by the API.
    - `metadata` object
      - `transformed` 1 — Post-processing may have transformed the data.
    - `status` 1 | 0 — * `1` — Success. * `0` — Failed. Check the `errors` field for more details.
    - `warnings` string[], nullable — List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.

---

[API](https://skmtc.net/cpanel/apis/cpanel-uapi.md) · [All operations](https://skmtc.net/cpanel/apis/cpanel-uapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/cpanel-uapi/revisions/632e2f8e6d04/schema)
