> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jelou.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Logs

> Monitore suas funções com jelou functions logs, ctx.log() para logging estruturado e jelou functions cron logs para execuções cron.

## Streaming ao vivo

Por padrão, `jelou functions logs` faz streaming em tempo real:

```bash theme={null}
jelou functions logs minha-funcao
```

## Logs históricos

```bash theme={null}
jelou functions logs minha-funcao --history
```

## Escrever logs da sua função

```typescript theme={null}
ctx.log("Processando pedido", { telefone: input.telefone });
// JSON estruturado: { requestId, function, company, timestamp, args }
```

<Note>
  `console.log()` também funciona, mas `ctx.log()` adiciona metadados úteis automaticamente.
</Note>

## Logs de cron

```bash theme={null}
jelou functions cron logs minha-funcao
jelou functions cron logs minha-funcao --state ERROR
```

## Modo JSON

```bash theme={null}
jelou functions logs minha-funcao --json
```
