# apex tail log

Activate debug logging and display logs in the terminal.

## Description for apex tail log

You can also pipe the logs to a file.

## Aliases for apex tail log

`force:apex:log:tail`

## Flags

| Flag Name (Long)    | Flag Name (Short) | Description                                                                                                                                         |
| ------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--api-version`     | N/A               | **Type:** Value<br><br>Override the api version used for api requests made by this command                                                          |
| `--color`           | `-c`              | **Type:** Boolean<br><br>Apply default colors to noteworthy log lines.                                                                              |
| `--debug-level`     | `-d`              | **Type:** Value<br><br>Debug level to set on the DEVELOPER_LOG trace flag for your user.                                                            |
| `--flags-dir`       | N/A               | **Type:** Value<br><br>Import flag values from a directory.                                                                                         |
| `--skip-trace-flag` | `-s`              | **Type:** Boolean<br><br>Skip trace flag setup. Assumes that a trace flag and debug level are fully set up.                                         |
| `--target-org`      | `-o`              | **Type:** Value<br>**Required**<br><br>Username or alias of the target org. Not required if the `target-org` configuration variable is already set. |

## Examples for apex tail log

Activate debug logging:

```shell
sf apex tail log
```

Specify a debug level:

```shell
sf apex tail log --debug-level MyDebugLevel
```

Skip the trace flag setup and apply default colors:

```shell
sf apex tail log --color --skip-trace-flag
```
