> ## Documentation Index
> Fetch the complete documentation index at: https://upstash-bulkdlqdelete.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Debug Logs

To debug the logs, first you need to understand the different states a message can
be in.

Only the last 10.000 logs are kept and older logs are removed automatically.

## Lifecycle of a Message

To understand the lifecycle of each message, we'll look at the following chart:

<Frame>
  [![](https://mermaid.ink/img/pako:eNptkWFvgjAQhv-KuY-LyoQNlQ9LiHaJCdmyiku2sSyVFmgClEAxMYb_vkJFna6f7p577_L27gChoAwcqCSRbMlJXJJstDODfKDe1933YDR6Giwwcn201PCYdAV34a_e0ZG7Lwvk_WD0tkHrXqChpzIt0g1dCWH8ijXtwg5i5OOPG-kSeSrEvYOLyrO78nrc9d7aurB7bfG67-YL1_b-H3Cy12nU0jTW3v6y8z6OGIaQsTIjnKojHFpRADJhGQvAUSFlEalTGUCQN0pKainW-zwER5Y1G0Jd0PPZwIlIWp0oolyK8gRTQShT6QHkvmgvHvNKqpGhyCMet7wuU4UTKYvKMYy2PI65TOrtOBSZUXGakFImu7lt2KY9I6bF7KlFHi2LhtvJfBaZD5OITu8nJoGmGUJB8k8helfNL76fr7o?type=png)](https://mermaid.live/edit#pako:eNptkWFvgjAQhv-KuY-LyoQNlQ9LiHaJCdmyiku2sSyVFmgClEAxMYb_vkJFna6f7p577_L27gChoAwcqCSRbMlJXJJstDODfKDe1933YDR6Giwwcn201PCYdAV34a_e0ZG7Lwvk_WD0tkHrXqChpzIt0g1dCWH8ijXtwg5i5OOPG-kSeSrEvYOLyrO78nrc9d7aurB7bfG67-YL1_b-H3Cy12nU0jTW3v6y8z6OGIaQsTIjnKojHFpRADJhGQvAUSFlEalTGUCQN0pKainW-zwER5Y1G0Jd0PPZwIlIWp0oolyK8gRTQShT6QHkvmgvHvNKqpGhyCMet7wuU4UTKYvKMYy2PI65TOrtOBSZUXGakFImu7lt2KY9I6bF7KlFHi2LhtvJfBaZD5OITu8nJoGmGUJB8k8helfNL76fr7o)
</Frame>

Either you or a previously setup schedule will create a message.

When a message is ready for execution, it will be become `ACTIVE` and a delivery to
your API is attempted.

If you API responds with a status code between `200 - 299`, the task is
considered successful and will be marked as `DELIVERED`.

Otherwise the message is being retried if there are any retries left and moves to `RETRY`. If all retries are exhausted, the task has `FAILED` and the message will be moved to the DLQ.

During all this a message can be cancelled via [DELETE /v2/messages/:messageId](https://docs.upstash.com/qstash/api/messages/cancel). When the request is received, `CANCEL_REQUESTED` will be logged first.
If retries are not exhausted yet, in the next deliver time, the message will be marked as `CANCELLED` and will be completely removed from the system.

## Console

Head over to the [Upstash Console](https://console.upstash.com/qstash) and go to
the `Logs` tab, where you can see the latest events.
