- API >
- API Resources >
- Monitoring and Logs >
- Logs
Logs¶
On this page
Retrieves a compressed (.gz
) log file that contains a range of log
messages for a particular host in an Atlas cluster.
Process and audit logs are updated from the cluster backend infrastructure every five minutes and contain log data from the previous five minutes. If you are polling the API for log files, polling every five minutes is recommended.
Example
If the logs are updated at 4:00 UTC and then you poll the API, the API returns log data from the interval between 3:55 UTC and 4:00 UTC.
Feature unavailable in Free and Shared-Tier Clusters
This feature is not available for M0
(Free Tier), M2
, and
M5
clusters. To learn more about which features are unavailable,
see Atlas M0 (Free Tier), M2, and M5 Limitations.
Note
Groups and projects are synonymous terms. Your {GROUP-ID}
is the
same as your project ID. For existing groups, your group/project ID
remains the same. The resource and corresponding endpoints use the
term groups
.
Important
You must be an owner
of the project that the cluster belongs to in
order to retrieve the log.
Base URL: https://cloud.mongodb.com/api/atlas/v1.0
Syntax¶
Request Path Parameters¶
Parameter | Required/Optional | Description |
---|---|---|
GROUP-ID |
Required | Project identifier. |
HOSTNAME |
Required | Name of the host where the log files that you want to download are stored. To see the hostnames of your Atlas cluster, visit the cluster overview page in the Atlas UI. |
LOG-NAME |
Required | The name of the log file that you want to retrieve:
|
Request Query Parameters¶
Field | Required/Optional | Description |
---|---|---|
startDate |
Optional. | Timestamp in the number of seconds that have elapsed since the UNIX epoch that specifies starting point for the range of log messages to retrieve. Default is 24 hours prior to the current timestamp. |
endDate |
Optional. | Timestamp in the number of seconds that have elapsed since the UNIX epoch that specifies the end point for the range of log messages to retrieve. Default is current timestamp. |
Request Body Parameters¶
This endpoint does not use HTTP request body parameters.
Response Elements¶
This endpoint does not return an HTTP response body.