Accessing logs

Agent Management records diagnostic logs for platform scans, data collection, uptime tests, alerting, and AI analysis. These logs help investigate operation failures. For the execution logs collected from remote agents into monitoring datasets, see Setting up monitoring and fetching data.

Reading instance logs with the client

In the following example, client is an AgentManagementClient created as described in The main AgentManagementClient class. Reading instance logs requires instance administrator privileges.

logs = client.list_logs()
for log in logs:
    print(log["name"], log["totalSize"])

if logs:
    log = client.get_log(logs[0]["name"])
    print("\n".join(log["tail"]["lines"]))

list_logs() returns a list of dictionaries describing the instance log files. Each dictionary includes name, totalSize in bytes, and lastModified as an epoch timestamp in milliseconds. Pass the name value to get_log(), which returns a dictionary containing the file metadata and a tail whose lines contain up to the last 1000 lines.

These methods access instance logs in the data directory’s run/ folder, such as backend.log. For the logs produced by a specific operation, use its status or result as described below.

Reading operation logs with the client

For platform scans, data fetches, uptime tests, and remote activation, call operation.get_status(include_logs=True) to retrieve available log lines in logs. Logs are omitted by default. get_result() includes available logs in the result dictionary’s logs entry without an additional option. See Asynchronous operations for examples.

Reading logs through a platform operation handle requires platform edit rights. Through an agent operation handle, it requires read access to every agent targeted by that operation. The logs are omitted when these permissions are not granted, while the status and result remain readable with their usual permissions.

Operation logs are stored in files and remain available after a server restart. The API reads the retained files, including rotated files. These files are deleted when the operation is removed from the history. If no file is available, the API can use the task history while it remains in memory.

The interface’s operation progress dialog also displays live logs. You can select a running operation under the platform’s or agent’s Activity > Operations page to view its progress and logs. The log browsers below provide the combined logs for a platform, an agent, or alerting.

Reading platform, agent, and alerting logs

Use the Agent Management interface to browse the dedicated diagnostic logs:

Logs

Location in the interface

Required privileges

Platform

Open the platform, then Activity > Logs.

Edit the platform.

Agent

Open the agent, then Activity > Logs.

Read the agent.

Alerting

Open Alerting > Activity > Logs.

Instance administrator.

AI analysis

Open Settings > AI analysis > Activity, then select an operation to view its logs.

Instance administrator.

The platform, agent, and alerting log browsers allow downloading individual files or an archive, including available rotated logs. Logs appear after the corresponding activities have run. Platform logs also include activities performed for their agents.

For operation status, errors, and results available through the client, see Asynchronous operations. For alert evidence and lifecycle history, see Working with triggered alerts.

Reference documentation

Functions

get_log(name)

Get the contents of a specific log file This call requires an API key with admin rights

get_result()

Returns the completed operation result, or None for operations without a result.

get_status()

Returns status information about this operation.

list_logs()

List all available log files on the Agent Management instance This call requires an API key with admin rights