-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
console.log() not logging in Functions > Logs #704
Comments
Are you certain your function is getting triggered? Additionally, you might want to look into using the new logging SDK (see release notes) for Node 10. |
No it's making the request and everything operates as usual it's just all of my logging is messed up in my Firebase console. Here's an example of an error response from Stripe being emitted with console.log(). It's separating every property to it's own line. Not sure why and I'm not able to sort by log level 'INFO' because none of this is given that log level even though it's being emitted with console.log |
In that case the new logging API is definitely what you want instead. Try upgrading
and see if you're still experiencing similar issues. |
@mbleigh Right so I did that and when I use functions.logger.log() I get a type error:
|
Are you certain you're on the latest SDK? The release was just yesterday:
|
Yep I just double checked to confirm. Could the way I'm importing it have anything to do with it? I use typescript. import * as functions from 'firebase-functions';
functions.logger.log('hello world') |
Ugh all I had to do was restart VS Code. Sorry about that! |
Related issues
[REQUIRED] Version info
node: 10
firebase-functions: 3.7.0
firebase-tools: 8.4.2
firebase-admin: 8.10.0
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
[REQUIRED] Expected behavior
It should log the different types of severity and be sortable in the firebase console
[REQUIRED] Actual behavior
Not logging any logs with a severity of 'INFO' when console.log() is used
Were you able to successfully deploy your functions?
Yes
The text was updated successfully, but these errors were encountered: