简体   繁体   English

Firebase 函数使用什么记录器?

[英]What logger to use for Firebase Functions?

Firebase recommends in their documentation to use their cloud functions logger SDK. Firebase 在他们的文档中建议使用他们的云功能记录器 SDK。 Does anyone recommend to use another logger such as Winston instead?有没有人建议使用其他记录器,例如 Winston?

  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.我个人更喜欢直接使用Cloud Logging 库,因为它可以在需要时提供更多自定义。 ( Firebase logging relies on it) Firebase 日志记录依赖它)

If you prefer Winston you have an implementation for Google Cloud.如果您更喜欢 Winston,您可以使用 Google Cloud 实现。 https://cloud.google.com/logging/docs/samples/logging-winston-quickstart 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).如果您打算坚持使用 Firebase/Google Cloud,我将为 Cloud Logging 使用 go,因为它也可以与其他 Google 服务(例如 Cloud Run)一起使用。 If not, Winston is almost and standard.如果不是,温斯顿几乎是标准的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Firebase 函数中使用 Map 的问题 - Problem to use a Map in Firebase Functions firebase的云函数不能使用serverTimestamp - Cloud functions for firebase can not use serverTimestamp 是否可以在 firebase 云函数中使用 setTimeout()? - is it possible to use setTimeout() in firebase cloud functions? 将 firebase auth 添加到 firebase 云功能的适当方法是什么 - What is the appropriate way to add firebase auth to firebase cloud functions 如何使用 fastify + nestjs + firebase 函数 - How to use fastify + nestjs + firebase functions 将 Firebase-functions-emulator 与远程 firebase 服务一起使用 - Use Firebase-functions-emulator with remote firebase services 如何使用云功能以使用 Firebase 云视觉 - How to use the Cloud Functions in order to use Firebase Cloud vision 如何在 netlify lamda 中使用 firebase 云函数的 firestore.onWrite() - How to use firebase cloud functions' firestore.onWrite() in netlify lamda 如何将 Firebase 参数化配置与 Typescript 一起用于 Cloud Functions? - How can I use Firebase Parameterized configuration with Typescript for Cloud Functions? Google Firebase 功能部署失败 - 我该怎么办? - Google Firebase Functions deployment fails - what can I do?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM