The ability to view logs was added to the basic functionality of Gcore CDN. The Log viewer allows you to obtain data about the system’s operation directly in the user interface or via API.
Why use this feature?
With the help of logs, you can get information about the operation of programs or user actions. This data is required to analyze system failures and track emergencies.
Previously, the clients of our CDN could receive logs only if they enabled a paid feature called Raw logs. Now, we’ve added a new functionality available for all plans. Compared to the extended paid one, it has a few limitations but provides a simple solution for most tasks.
How to view logs for free?
The feature is available by default to all Gcore CDN clients. You don’t need to connect anything additionally.
There are two ways to view logs.
1. Viewing logs in the control panel
Logs can be viewed and exported using the interface of our control panel. You can obtain data from the past 15 days.
- Log viewer in the Gcore control panel
You can view the list of logs and detailed information about each entry: client IP address, request time, HTTP method, response size, etc.
- Request details
The data can be filtered by time (set for a particular time interval) and other parameters (e.g., by client IP address).
In addition, you can export the log file. You’ll receive data from a particular time interval, filtered according to the parameters you need.
- Log export
2. Viewing logs via API
Just like in the control panel, you can view logs from the past 15 days.
You can obtain the data at any time and save it if necessary. The maximum number of API requests is four per second.
The following fields are available in exported logs:
- path—requested file.
- method—the method of the HTTP request. It specifies the action to be performed with this resource. For example, GET is a method that requests data from a resource.
- referer—the value of the Referer header in the request. This header contains the URL of the source page from which the user came to the current page (i.e., the source from which the user came to the resource).
- user_agent—the value of the User-Agent header in the request. This header contains information about the software and characteristics of the client: the device’s operating system, the browser with which the client came to the website, and other details.
- client_ip—the IP address of the client that sent the request.
- status—the response code of the request. It shows whether the request was processed successfully.
- cname—the personal domain of the requested resource.
- resource_id—the identifier of the requested resource.
- cache_status—cache status. It shows whether the information was taken from the cache.
- datacenter—the data center that handled the request.
- timestamp—the date and time when the request was received by the CDN.
- size—the size of the response in bytes.
There are two ways to obtain logs via API.
1. Return logs with a request. You’ll get no more than 1,000 entries. The maximum interval for the data in a request is 6 hours. Hence, you can request data from any 6-hour (or shorter) interval from the past 15 days.
2. Download a file. The log file is exported. It can contain up to 10,000 entries. The maximum interval for the data is 24 hours.
The result will look approximately like this:
- Log example
- The option of viewing logs was added to our CDN’s basic functionality. The new feature is available to all Gcore CDN clients by default.
- Unlike the Raw logs option, our new feature is free. But it has some limitations.
- Logs can be viewed using the control panel or API requests.
We are constantly expanding the CDN’s functionality to make it even more convenient for our clients. To learn more about all available features, go to the product’s website.