> ## 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

> Monitor your functions with jelou functions logs, ctx.log() for structured logging, and jelou functions cron logs for cron executions.

## Live streaming

By default, `jelou functions logs` streams logs in real time:

```bash theme={null}
jelou functions logs my-function
# ▸ Streaming logs for my-function
# ▸ Press Ctrl+C to stop
```

## Historical logs

```bash theme={null}
jelou functions logs my-function --history
```

## Write logs from your function

```typescript theme={null}
ctx.log("Processing order", { phone: input.phone, requestId: ctx.requestId });
// Writes structured JSON: { requestId, function, company, timestamp, args }
```

<Note>
  `console.log()` also works but `ctx.log()` adds useful metadata (requestId, function, company, timestamp) automatically.
</Note>

## Cron logs

```bash theme={null}
jelou functions cron logs my-function
jelou functions cron logs my-function --state ERROR
```

## JSON mode

```bash theme={null}
jelou functions logs my-function --json
jelou functions logs my-function --history --json
```
