Skip to main content
Skip to main content

How to access logs in zCLI

To start the VPN you need first install & setup zCLI, the Zerops command-line tool.

Build log

To access a build log in Zerops CLI use

zcli service log --showBuildLogs

The command returns the build log to stdout with a streaming option. By default the command returns the last 100 log messages and exits. Use the --follow flag to continuously pool for new log messages.

Command annotation

Usage:
zcli service log [flags]

Flags:
--follow If set, zCLI will continuously poll for new log messages. By default, the command will exit
once there are no more logs to display. To exit from this mode, use Control-C.
--format string The format of returned log messages. Following formats are supported:
FULL: This is the default format. Messages will be returned in the complete Syslog format.
SHORT: Returns only timestamp and log message.
JSON: Messages will be returned as one JSON object.
JSONSTREAM: Messages will be returned as stream of JSON objects. (default "FULL")
--formatTemplate string Set a custom log format. Can be used only with --format=FULL.
Example: --formatTemplate="{{.timestamp}} {{.severity}} {{.facility}} {{.message}}".
Supports standard GoLang template format and functions.
-h, --help the service log command.
--limit int How many of the most recent log messages will be returned. Allowed interval is <1;1000>.
Default value = 100. (default 100)
--messageType string Select either APPLICATION or WEBSERVER log messages to be returned. Default value = APPLICATION. (default "APPLICATION")
--minimumSeverity string Returns log messages with requested or higher severity. Set either severity number in the interval
<0;7> or one of following severity codes:
EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, NOTICE, INFORMATIONAL, DEBUG.
--projectId string If you have access to more than one project, you must specify the project ID for which the
command is to be executed.
--serviceId string If you have access to more than one service, you must specify the service ID for which the
command is to be executed.
--showBuildLogs If set, zCLI will return build log messages instead of runtime log messages.

zCLI commands are interactive, when you press enter after zcli service log, you will be given a list of your projects to choose from.

Runtime log

To access the log of the first runtime container in Zerops CLI use

zcli service log

The command returns the runtime log of the first container to stdout with a streaming option. By default the command returns the last 100 log messages and exits. Use the --follow flag to continuously pool for new log messages.