firebase-functions: logger.error doesn't show in the "Health" tab anymore

[REQUIRED] Environment info

Not sure if this is the right place to post this in the myriad of issue trackers. Sorry in advance.

firebase-tools: 9.16.3

Platform: Node 14

[REQUIRED] Test case

Doing a logger.error('Something') no longer shows up in the health tab in the firebase console under Functions->Health.

[REQUIRED] Steps to reproduce

import { logger } from 'firebase-functions'; logger.error('Something') Notice that it doesn’t show up in the health tab anymore

[REQUIRED] Expected behavior

That it shows up there - we need to log handled errors to the health tab.

[REQUIRED] Actual behavior

It never shows up

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (6 by maintainers)

Most upvoted comments

I’m having the same issue, the documentation states that using:

console.error(new Error('I failed you'));
console.error('I failed you', new Error('I failed you too'));
throw new Error('I failed you'); // Will cause a cold start if not caught

Will get reported to Error reporting and should be logged as an Error in the “cloud functions” panel. But it doesn’t when using the second method: console.error('I failed you', new Error('I failed you too'));

Only the other two will report the error.

@larssn That sounds possible. Given the state of things now, I think we can shape our conversation here as a feature request to automatically wrap strings passed into functions.logger.error as an error object. This is arguably backward incompatible change (maybe people don’t want errors to show up on Error Reporting? 🤷), so we could sneak it in on the next major release.