Skip to main content

What is Log viewer

Log viewer is a free tool designed to view and export logs of CDN resources to your device. With it, you can see and download information about requests to your resources. The service stores the logs that were recorded for the last 3 days of CDN operation.
Log viewer

View logs in the Customer Portal

Log viewer can show logs collected for a maximum of 6 hours of CDN operation. Moreover, it can only display up to 1000 log entries. If more than 1000 logs have been recorded in six hours, entries after the 1000th will not be shown. When you open the tab, you can see logs of all CDN resources for the last 6 hours.
logs in the Gcore Customer Portal
You can customize a log report:
  • To see logs of a specific CDN resource, enter its CNAME or ID.
  • To filter logs, click “Add filter” and set the required parameter: time, user’s IP address, HTTP method, status code, data center, or cache status.
  • To see logs for another time interval, click the timestamp field and specify your values. You can choose any interval of up to 6 hours for any of the last 3 days.
customize a log report
To see more details about a log, hover the mouse over the “i” icon on the right. You will see twelve request parameters.
more details about a log
  • Client IP — an IP address of the client who sent the request.
  • Timestamp — UTC time of the request.
  • Method — an HTTP request method (GET, POST, DELETE, etc.).
  • Request URL — a URL of the requested page or file.
  • Status code — a status of the response that was returned to the client.
  • Refer header — a URL of the page from which the client opened the requested page. If it was a direct transition, the header will contain a dash.
  • Size — the number of bytes in the response.
  • Data center — a Gcore data center that received the client’s request.
  • User-Agent — information about the client’s browser and operating system.
  • Cache status — a source of the response: HIT means the response was sent from the CDN resource, MISS means the response was sent from the website.
  • Resource ID — an ID of the requested CDN resource.
  • CNAME — a CNAME of the requested CDN resource.

Export logs

Log viewer allows you to download a file with logs collected for a maximum of 24 hours of CDN operation. One file can contain up to 10,000 log entries. If more logs have been collected in 24 hours, entries after the 10,000th will not be written to an export file. Logs are exported based on the filters that you have applied. To download logs to your PC: 1. Click the Export button on the right side of the page. 2. Select the time range of logs you want to download: you can keep the current period (selected in filters when viewing), or set a new value. 3. Choose the export format: CSV or TSV. 4. Click Export. The file will be downloaded to your browser download location.
Export

Manage Log viewer via the API

You can also view and download logs via the API using requests from our API documentation. Below we explain how to create a request. 1. In a tool for working with an API, add an authorization header. Choose one of the two headers below, copy it, replace the expression in brackets with your data and remove the brackets. 2. Set the GET request type and specify a path for the required action:
  • A path to view — https://api.gcore.com/cdn/advanced/v1/logs.
  • A path to export — https://api.gcore.com/cdn/advanced/v1/logs/download.
3. Add the request parameters to filter the logs for the report. Enter each parameter on a new line. For example:
4. Send the created API request. Let’s look at an example of a request. Assuming, we want to view logs with the following parameters:
  • Time range is from 6:00 to 12:00 (UTC) on April 27, 2022.
  • The report should only contain the request method, the request path, the status of the response, the data center and the size of the request.
  • We don’t need all the entries in the report; we only want to see logs about GET or POST requests whose responses were smaller than 100 bytes and had 3xx response codes.
We open a tool for working with an API and do as follows: 1. We specify the request path for log viewing: https://api.gcore.com/cdn/advanced/v1/logs. 2. We specify the request method: GET. 3. We add the Authorization header and its value. We want to log in with a permanent token, so we specify our token “APIKey 7711_eyJ0eXAiOiJKV”. 4. We enter the request parameters:
5. We send the request.