Closed Kylar13 closed 2 years ago
I'm guessing it is somehow related to this: https://github.com/googleapis/nodejs-logging/issues/1185
@Kylar13 it is known, these are relevant too: https://github.com/googleapis/nodejs-logging-bunyan/issues/595, https://github.com/googleapis/nodejs-logging-bunyan/pull/601
@Kylar13 , thanks for opening the issue! Can you please upgrade to latest 3.2.2 package and follow instructions suggested in error-handling-with-a-default-callback to handle timeout errors? Also, can you tell me if timeouts you experience somehow related to a nodejs-logging-bunyan
library upgrade or it is temporary situation?
As far as I can tell, it's due to logging on the "onFinished" callback, since I log a "Logger ready" after initialization, and it logs normally. The problem is that when I try to await it, it makes no difference since I'm using bunyan and not the base logging library. The error handling will help in the app not crashing, but I still won't get logs, right?
Any updates on this?
Sorry @Kylar13 for late reply - you right, while crashing can be prevented, still logs might not be written due to a lack of await
capabilities. I believe that one of the possible solutions here is to use console logging with Google Logging Agent (which should be available in GCP) - the nodejs-logging library introduced LogSync class which supports structured logging output into console. From the console log records are picked by the agents running in GCP nodes and delivered to Cloud Logging. However, LogSync
class is not integrated with nodejs-logging-bunyan
and requires a code change. Please let me know if you think this could be acceptable solution.
Thanks a lot for your patience - I believe this issue is addressed by 605. Feel free to reactivate or comment if you have more concerns.
I can confirm this fixed my issues in Cloud Functions.
Thank you @pmwisdom for confirmation!
No matter what I try, I'm getting the following error when logging to GCP using Bunyan and this library
Providing a minimal reproduction. Unsure if it's a bug or just something that I'm doing wrong
I get nothing on stdout or GCP until a minute passes and then the error shows and the app crashes.
Thanks in advance for the help!!