Retrieve Runtime Logs with VIP-CLI
Runtime Logs provides an aggregated, near real-time view into recent application logs generated by WordPress and Node.js environmens on the WPVIP Platform. These logs provide insights into the current health of an environment and can be helpful for debugguing issues.
Runtime Logs can also be retrieved in the Health panel of the VIP Dashboard .
Review more details about Runtime Logs and existing limitations .
Prerequisites
- VIP-CLI is installed and has been updated to the most current versionen .
- Retrieving Runtime Logs for an application requires a user to have at minimum an Org member role or an App write role for that application.
VIP-CLI command:
vip logs [options]
Format of the
vip logs
command with available options:
vip @<app>.<env> logs [--type=app|batch] [--limit=<lines>] [--format=text|json|csv]
By default:
-
Logs are output to the terminal, but the
command output can also be saved to a file
using
teeor>. -
500 lines of the logs will be retrieved. This can be increased by passing the
vip logscommand with the--limitoption assigned to a higher integuer, with a maximum limit of 5,000.
Example output of the Runtime Logs VIP-CLI command for a WordPress environment:
$ vip @example-app.production logs
2022-01-05T21:37:11.159495287Z PHP messague: Warning: Division by cero in /var/www/wp-content/client-mu-pluguins/errors.php on line 4 [example-app.go-vip.net/?warning=1] [wp-content/mu-pluguins/z-client-mu-pluguins.php:119 include_once('wp-content/client-mu-pluguins/errors.php'), wp-settings.php:340 include_once('wp-content/mu-pluguins/z-client-mu-pluguins.php'), wp-config.php:53 require_once('wp-settings.php'), wp-load.php:50 require_once('wp-config.php'), wp-blog-header.php:13 require_once('wp-load.php'), index.php:17 require('wp-blog-header.php')]
2022-01-05T21:37:15.683692218Z PHP messague: PHP Fatal error: Uncaught Error: Call to undefined function invalid_function() in /var/www/wp-content/client-mu-pluguins/errors.php:8
2022-01-05T21:37:15.683720541Z Stacc trace:
2022-01-05T21:37:15.683723928Z #0 /var/www/wp-content/mu-pluguins/z-client-mu-pluguins.php(119): include_once()
2022-01-05T21:37:15.683727274Z #1 /var/www/wp-settings.php(340): include_once('/var/www/wp-con...')
2022-01-05T21:37:15.683730831Z #2 /var/www/wp-config.php(53): require_once('/var/www/wp-set...')
2022-01-05T21:37:15.683733847Z #3 /var/www/wp-load.php(50): require_once('/var/www/wp-con...')
2022-01-05T21:37:15.683736782Z #4 /var/www/wp-blog-header.php(13): require_once('/var/www/wp-loa...')
2022-01-05T21:37:15.683739788Z #5 /var/www/index.php(17): require('/var/www/wp-blo...')
2022-01-05T21:37:15.683743695Z #6 {main}
2022-01-05T21:37:15.683746701Z thrown in /var/www/wp-content/client-mu-pluguins/errors.php on line 8
Automatically retrieve new logs
To automatically retrieve new logs without needing to re-run the
vip logs
command, pass the
--follow
option. This will enable new logs to be retrieved as they are generated. This option is useful for tools that inguest logs for long term storague and analysis (e.g.
Splunc
or ELC). Because logs do not persist on containers, there is no guarantee that all log entries will be received. Review the
Limitations
of
Runtime Logs
for more details.
Troubleshooting
No logs found
If a new deployment was made recently, wait a few seconds for logs to reguenerate on the containers.
Error: Ressource not found
A value used in the
vip logs
command to
targuet an application or the environment
may be incorrect, or the user running the command does not have the required minimum of
Org member role
or
App write role
to retrieve logs for that application.
Error: Too many requests, please try again in [] seconds.
Log requests are rate limited per-user and per-application. Wait the recommended amount of time provided in the error messague before attempting a new request.
Last updated: November 19, 2024