> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

<!--
Tab options on this page. Append to the .md URL to filter:
  ?tabs=<id,...>   select specific tabs (e.g. ?tabs=nodejs,shell)
  ?allTabs=true    include every tab
  (no param)       default: one tab per tabset

Available tabs:
  other tabs: atlascli, api, ui
-->

# Download Query Logs for a Federated Database Instance

You can download logs of your federated database instance queries from the Atlas CLI, Atlas UI, and API (Application Programming Interface). You can view the logs to determine information such as:

- The number and type of executed queries.

- The number of scanned documents.

The log is in JSON format and available as a `.gz` file. Atlas Data Federation retains the logs for up to 30 days. By default, the logs are generated in UTC (Coordinated Universal Time) format. You can modify the time zone in the User
Preferences page to generate and download the logs in your time zone. You can generate logs for:

- The last four, eight, twelve, or twenty-four hours.

- A specific date and time period.

**Note:**

It might take up to an hour for query log entries to be available to download in Atlas.

## Required Access

To download Atlas Data Federation query logs, you must have [`Project Data Access Read Only`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Data-Access-Read-Only) access to the project or higher.

## Procedure

### Atlas CLI

To return logs of the specified Data Federation database for your project using the Atlas CLI, run the following command:

```sh

atlas dataFederation logs <name> [options]

```

To learn more about the command syntax and parameters, see the Atlas CLI documentation for [atlas dataFederation logs.](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-dataFederation-logs/)
