Azion CLI logs
Azion CLI commands that show the console logs of your functions and the HTTP event logs of your applications, with every flag, its type, and its default.
The Azion CLI logs commands print recent logs in the terminal. azion logs cells shows the console logs of your functions, and azion logs http shows the HTTP event logs of your applications. The options every command accepts, such as --debug, --timeout, and -c, are on Global options.
Usage
azion logs takes the kind of log as a subcommand, cells or http:
The command takes no flags of its own. -h or --help prints the help of the command, and azion logs <subcommand> --help prints the help of one subcommand.
azion logs cells
azion logs cells shows the console logs that your functions write. cells is the name the CLI gives to function console logs. The command returns the logs of the last 5 minutes:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--function-id | — | string | — | ID of the function whose logs you want. Without it, the command shows the logs of every function. |
--limit | — | string | "100" | Number of log entries the command shows at a time. |
--pretty | — | — | — | Prints the logs in a formatted layout. |
--tail | — | — | — | Keeps the command running and prints logs as they arrive, like tail -f. Between logs, it prints Waiting for the next event.... |
To find the ID of a function, refer to Azion CLI function.
azion logs http
azion logs http shows the HTTP event logs of your applications, one entry per request, oldest first. The command returns the logs of the last 5 minutes:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--limit | — | string | "100" | Number of log entries the command shows at a time. |
--pretty | — | — | — | Prints each field of an entry on its own line. |
--tail | — | — | — | Keeps the command running and prints logs as they arrive, like tail -f. Between logs, it prints Waiting for the next event.... |
Each entry carries the timestamp, host, request URI, status, user agent, region name, bytes sent, request time, and request method of one request.
Examples
These examples read the HTTP event logs of an application that serves a static site.
Show HTTP event logs
This command shows five HTTP event logs:
The command prints one line per request:
Show HTTP event logs field by field
This command shows two HTTP event logs in the readable layout:
The command prints each field on its own line, with a blank line between requests:
Follow HTTP event logs as they arrive
This command prints the HTTP event logs of the last 5 minutes and keeps running:
While no request arrives, the command prints Waiting for the next event.... Each new request appears when it is logged, and the command runs until you stop it: