serverless-google-cloudfunctions
serverless-google-cloudfunctions copied to clipboard
SLS logs --tail broken on google-nodejs template
Bug Report
Description
- What did you do?
I've deployed a very simple function to GCP that logs upon topic publish. When publishing a topic I'm able to see the console.log statement in the logs. When adding the
-tor--tailargument however, the tail does not hold and simply acts as it would without the tail. - What happened? It ignored the tail flag
- What should've happened? It should have tailed the log stream
- What's the content of your
serverless.ymlfile?
service: cloud-functions
provider:
name: google
stage: dev
runtime: nodejs10
region: us-east1
project: cloud-functionsxxxxx
# The GCF credentials can be a little tricky to set up. Luckily we've documented this for you here:
# https://serverless.com/framework/docs/providers/google/guide/credentials/
#
# the path to the credentials file needs to be absolute
credentials: ~/.gcloud/cloud-functionsxxxxx-serverless-key.json
plugins:
- serverless-google-cloudfunctions
# needs more granular excluding in production as only the serverless provider npm
# package should be excluded (and not the whole node_modules directory)
package:
exclude:
- node_modules/**
- tooling/**
- .gitignore
- .git/**
functions:
sendSlackNotification:
handler: sendSlackNotification
events:
- event:
eventType: providers/cloud.pubsub/eventTypes/topic.publish
resource: 'projects/${self:provider.project, ""}/topics/sendSlackNotification'
- What's the output you get when you use the
SLS_DEBUG=*environment variable (e.g.SLS_DEBUG=* serverless deploy)
$ SLS_DEBUG=* sls logs --function sendSlackNotification --tail
Serverless: Load command interactiveCli
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command config:tabcompletion
Serverless: Load command config:tabcompletion:install
Serverless: Load command config:tabcompletion:uninstall
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command logs
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command generate-event
Serverless: Load command test
Serverless: Load command dashboard
Serverless: Invoke logs
Serverless: Displaying the 10 most recent log(s):
2019-12-06T04:46:56.055619663Z: Function execution took 206 ms, finished with status: 'ok'
2019-12-06T04:46:56.044Z: Sending Slack Notification
2019-12-06T04:46:55.850123325Z: Function execution started
Serverless Version:
$ sls -v
Framework Core: 1.59.1
Plugin: 3.2.5
SDK: 2.2.1
Components Core: 1.1.2
Components CLI: 1.4.0
Similar or dependent issues:
- serverless/serverless#5497