---
title: "lean logs"
description: "API reference for the command `lean logs` in command line console."
canonical: https://www.quantconnect.com/docs/v2/lean-cli/api-reference/lean-logs
markdown: https://www.quantconnect.com/docs/v2/lean-cli/api-reference/lean-logs.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/05%20Lean%20CLI/99%20API%20Reference/44%20lean%20logs
modified: 2026-10-29
index: https://www.quantconnect.com/llms.txt
---

# lean logs

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Lean CLI](https://www.quantconnect.com/docs/v2/lean-cli.md) > [API Reference](https://www.quantconnect.com/docs/v2/lean-cli/api-reference.md) > lean logs

> Code examples are shown in Python. Append `?lang=csharp` to this URL for the C# version of this page.

## Introduction

Display the most recent backtest/live/optimization logs.

```
$ lean logs [OPTIONS]
```

To use the CLI, you must be a member in an [organization](https://www.quantconnect.com/docs/v2/cloud-platform/organizations/tier-features.md) on a paid tier.

## Description

Displays the most recent backtest/live/optimization logs. By default, the most recent backtest logs are shown unless `--live` or `--optimization` is given. You can pass in a project with `--project <directory>` to display the most recent logs from a specific project.

## Options

The `lean logs` command supports the following options:

| Option | Description |
| --- | --- |
| `--backtest` | Display the most recent backtest logs (default) |
| `--live` | Display the most recent live logs |
| `--optimization` | Display the most recent optimization logs |
| `--project <directory>` | The project to get the most recent logs from |
| `--lean-config <file>` | The Lean configuration file that should be used (defaults to the nearest lean.json) |
| `--verbose` | Enable debug logging |
| `--help` | Display the help text of the `lean logs` command and exit |
