In Google App Engine Flexible environment many Logs are skipping, and not getting shown in the Logging console, and it is happening always, I am checking it on Stackdriver Logging
section on Google Cloud dashboard, the Logs I am showing using console.log()
are getting skipped but mongoose
query logs are getting printed.
Also, now currently sometimes my logs console.logs
are getting shown but sometimes not, but previously they were getting shown every time. Why now is it not working every time?
Can anyone please tell me why is this happening?
Thank You
Edit-
I have added debugging points but the thing is my debug points are executed, but how come in the logs they are not getting printed?
Also, I am using the same code on compute engine but there logs all logs are getting printed, but in App Engine for some cases, they are missing eveytime?
The problem was happening because there is some compatibility issue between 0x and App engine, I was using 0x in start script like this 0x server.js
So, my server.js file with 0x that's why I think it was getting loaded before trace agent, and that's why the error was there I guess.
I was getting below error previously which I have also asked separately in this thread here
ERROR:@google-cloud/trace-agent: TraceAgent#start: Tracing might not work as the following modules were loaded before the trace agent was initialized: [0x]
But I just thought it will not cause issues for Google Cloud Logging, but the thing is when I removed this module and from the start script the issue was resolved.
Well I think
Google must change this error and should also mention Google Cloud Logging in the error, otherwise if someone is also using 0x with app engine they will also face issues resolving these kinds of errors.
If you believe it's a compatibility issue, then you can go to our Issue Tracker and open a feature request to have it fixed. Please provide all the details on the 0x module so we can figure out why it's not working.
来源:https://stackoverflow.com/questions/52065164/google-app-engine-why-some-logs-are-not-getting-shown