mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
2.0 KiB
2.0 KiB
Read this on the main serverless docs site
Tencent-SCF - Logs
Lets you watch the logs of a specific function deployed in Tencent Cloud.
serverless logs -f hello
# Optionally tail the logs with -t
serverless logs -f hello -t
Options
--functionor-fThe function you want to fetch the logs for. Required--stageor-sThe stage you want to view the function logs for. If not provided, the plugin will use the default stage listed inserverless.yml. If that doesn't exist either it'll just fetch the logs from thedevstage.--regionor-rThe region you want to view the function logs for. If not provided, the plugin will use the default region listed inserverless.yml. If that doesn't exist either it'll just fetch the logs from theap-guangzhouregion.--startTimeA specific unit in time to start fetching logs from (ie:2019-7-12 00:00:00).--tailor-tYou can optionally tail the logs and keep listening for new logs in your terminal session by passing this option.--intervalor-iIf you choose to tail the output, you can control the interval at which the framework polls the logs with this option. The default is1000ms.
Examples
Note: There's a small lag between invoking the function and actually having the log event registered in Tencent Cloud Log Service. So it takes a few seconds for the logs to show up right after invoking the function.
serverless logs -f hello
This will fetch the logs from last 10 minutes as startTime was not given.
serverless logs -f hello -t
Serverless will tail the function log output and print new log messages coming in starting from 10 seconds ago.