简体   繁体   中英

What logger to use for Firebase Functions?

Firebase recommends in their documentation to use their cloud functions logger SDK. Does anyone recommend to use another logger such as Winston instead?

  const functions = require("firebase-functions");
  functions.logger.log("Hello from info");

I personally prefer to use directly Cloud Logging library as it gives more customization if needed. ( Firebase logging relies on it)

If you prefer Winston you have an implementation for Google Cloud. https://cloud.google.com/logging/docs/samples/logging-winston-quickstart

I would choose one or another depending on "portability". If you plan to stick with Firebase/Google Cloud I will go for Cloud Logging as it will work also with other Google services (ex. Cloud Run). If not, Winston is almost and standard.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM