-
Notifications
You must be signed in to change notification settings - Fork 115
Viewing logs
Table of Contents
Viewing your functions' logs is easy:
functions logs read
By default it will print the last 20 lines. You can view more with the --limit
flag:
functions logs read --limit=100
or
functions logs read -l=100
Logs are written to the file specified by the logFile
setting. The default location for the log file is logs/cloud-functions-emulator.log
, relative to the directory where the Emulator is installed.
You can set the absolute location for the log file:
functions config set logFile /your/desired/path/to/the/logfile.log
or specify a relative path, which will be interpreted as being relative to the Emulator's installation directory:
function config set logFile relative/path/to/logfile.log
You can view the full path to the current log file with:
functions status
If the Emulator is currently running, then you'll see an entry printed like this:
├────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Log file │ /Users/jmdobry/.nvm/versions/node/v6.9.1/lib/node_modules/@google-cloud/functions-emulator/logs/cloud-functions-emulator.log │
├────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
If the Emulator is stopped, then it will try to print the path to the log file last used:
├───────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Last log file │ /Users/jmdobry/.nvm/versions/node/v6.9.1/lib/node_modules/@google-cloud/functions-emulator/logs/cloud-functions-emulator.log │
└───────────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Disclaimer: This is not an official Google product.
@google-cloud/functions-emulator is currently in pre-1.0.0 development. Before the 1.0.0 release, backwards compatible changes and bug fixes will bump the patch version number and breaking changes will bump the minor version number.