Closed mat105 closed 1 year ago
Any update on this? Seeing the same behavior.
Sorry on late response @mat105 and @Bmgaynor. Please see corresponding answers to your question:
stdout
and LoggingBunyan.stream
you will have duplicate records which I believe should be avoided.redirectToStdout
, indeed the logName
is going to be overriden by Cloud Run/Functions. This is by design as of now we have an open issue to resolve this matter and we dont have a clear ETA. Thats said, we do embed logName
in jsonPayload
when logs are printed to stdout
.false
the useMessageField
described here.redirectToStdout
is more reliable in Cloud Run/Functions - I would recommend to update to latest library and retry your code with redirectToStdout = true
and useMessageField = false
and sharing your feedback if the output looks acceptable.Closing this issue for now since seems there is no more comments - feel free to ask more questions or reactivate per need. Thanks!
@losalex any update on the logName overriden by Cloud Run? We need to used sink to route the logs to gcs, but since sinks don't support paths, and logName is not configurable, we have to create a bucket per service and this generates a lot of overhead
Hello.
I'm trying to add logs on my nodejs CF with bunyan.
My logging setup looks like this:
It seems to work OK on the logging explorer, severity and jsonPayload of logs is shown OK, but on the CF records tab it shows this:
Based on the documentation, it says we should prefer setting
redirectToStdout: true
for cloud functions, but when i do this, the logName doesn't show up. In order to avoid log duplication in the logging explorer i commented the stream that is mapped to process.stdout.My questions are: