使用 stdout/stderr 从节点进行 Stackdriver 日志记录
Stackdriver logging from node with stdout/stderr
在Google Cloud 上,当在nodejs 中使用GAE 或cloud function 时,我们可以直接通过stdout 登录到stackdriver,他们解释here 如下:
Note: Logs written to stdout and stderr are automatically sent to Stackdriver Logging for you, without needing to use the Stackdriver Logging libraries for Node.js.
是否可以为这些日志添加结构?喜欢 jsonPayload
?
如果可能的话,我很想避免使用客户端库。
App Engine 和 Cloud Functions 都监听 std 并且可以直接登录到 Stackdriver。进一步定制的推荐方法是直接使用客户端库而不是登录到 std。目前,您可以使用 jsonPayload 字段向 Stackdriver 日志记录添加结构,但调用仍需要通过客户端库。请在 Google 问题跟踪器上为您检查以下 article for reference. I have already created a feature request,以便它可以帮助您获得您所请求的功能。
在Google Cloud 上,当在nodejs 中使用GAE 或cloud function 时,我们可以直接通过stdout 登录到stackdriver,他们解释here 如下:
Note: Logs written to stdout and stderr are automatically sent to Stackdriver Logging for you, without needing to use the Stackdriver Logging libraries for Node.js.
是否可以为这些日志添加结构?喜欢 jsonPayload
?
如果可能的话,我很想避免使用客户端库。
App Engine 和 Cloud Functions 都监听 std 并且可以直接登录到 Stackdriver。进一步定制的推荐方法是直接使用客户端库而不是登录到 std。目前,您可以使用 jsonPayload 字段向 Stackdriver 日志记录添加结构,但调用仍需要通过客户端库。请在 Google 问题跟踪器上为您检查以下 article for reference. I have already created a feature request,以便它可以帮助您获得您所请求的功能。