Function: apivpn_get_connection_log_file
This function returns the path to the connection log file, which provides insights into the VPN's connection activities.
Description:
The connection log file offers detailed information about either the ongoing VPN session or the last completed session. Each line within this log represents an individual connection and is formatted in JSON. The structure provides a comprehensive view of each connection's attributes and statistics.
Example Entry:
{
"start": 1690090880,
"end": 1690090893,
"bytes_recvd": 364468,
"bytes_sent": 590,
"host": "www.cloudflare.com",
"port": 443,
"protocol": "TCP",
"outbound_tag": "Proxy",
"rule_type": "DOMAIN"
}
Field Descriptions:
- start: Timestamp marking when the connection was initiated.
- end: Timestamp marking when the connection concluded.
- bytes_recvd: Total bytes received during the connection.
- bytes_sent: Total bytes sent during the connection.
- host: Destination host, which can either be a domain name or an IP address.
- port: Destination port number.
- protocol: Specifies the protocol type, either "TCP" or "UDP".
- outbound_tag: Tag associated with the outbound handling the connection.
- rule_type: Indicates the type of rule matched for the connection. Possible values include:
- NONE: No rule was matched.
- IP: Rule matched based on IP.
- GEOIP: Rule matched based on geographic IP.
- DOMAIN: Rule matched based on the domain.
Returns:
Path to the connection log file.
Usage:
To acquire details about connection activities within a session, invoke the apivpn_get_connection_log_file
function and process the retrieved log file as needed.