Virtualizor has logging enabled by default. The IP Logs are stored indefinitely on the server and can be removed by using the Delete IP Logs API.
The API response will contain "iplogs" as an empty array after successful deletion of the IP logs.
HTTP Request
https://hostname:4085/index.php?act=iplogs
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | iplogs | The action will return data after performing the operation | Yes |
delete | POST | 1/0 | If set then the logs will be deleted from the server | Yes |
Sample Code
<?php
require_once('/usr/local/virtualizor/sdk/admin.php');
$key = 'your_api_key';
$pass = 'your_api_pass';
$ip = 'your_server_ip';
$admin = new Virtualizor_Admin_API($ip, $key, $pass)
$post = array();
$post['delete'] = 1 ;
$output = $admin->deleteiplogs($post);
print_r(json_encode($output));
?>
Output
{
"title": "IP Logs",
"current_status": null,
"iplogs": [],
"timenow": 1481714110,
"time_taken": "0.109"
}