---
id: api/commands/log
title: log | Cypress Documentation
description: Print a message to the Cypress Command Log.
section: api
source_path: docs/api/commands/log.mdx
version: ce02913654e2655ee63448bdc92bb92c7b46a619
updated_at: '2026-04-22T19:37:51.587Z'
---
# log

Print a message to the Cypress Command Log.

## Syntax

```javascript
cy.log(message)
cy.log(message, args...)
```

### Usage

 **Correct Usage**

```javascript
cy.log('created new user')
```

### Arguments

 **message *(String)***

Message to be printed to Cypress Command Log. Accepts a Markdown formatted
message.

 **args...**

Additional arguments to be printed to the Cypress Command Log. There is no limit
to the number of arguments.

### Yields [Learn about subject management](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management)

- `cy.log()` yields `null`.

## Examples

### Message

#### Print a message to the Command Log.

```javascript
cy.click('Login')
cy.log('Login successful')
```

### Args

#### Print a message with arguments to the Command Log.

```javascript
cy.log('events triggered', events)
```

## Rules

### Requirements [Learn about chaining commands](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Chains-of-Commands)

- `cy.log()` requires being chained off of `cy`.

### Assertions [Learn about assertions](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Assertions)

- `cy.log()` cannot have any assertions chained.

### Timeouts [Learn about timeouts](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Timeouts)

- `cy.log()` cannot time out.

## Command Log

***Print messages with arguments to the Command Log.***

```javascript
cy.log('log out any message we want here')
cy.log('another message', ['one', 'two', 'three'])
```

The commands above will display in the Command Log as:

When clicking on `log` within the command log, the console outputs the
following:

## See also

- [`cy.exec()`](/llm/markdown/api/commands/exec.md)
- [`Cypress.log`](/llm/markdown/api/cypress-api/cypress-log.md)
- [`cy.task()`](/llm/markdown/api/commands/task.md)
