5

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?

Sudhanshu Gaur
  • 7,486
  • 9
  • 47
  • 94
  • Is your application deployed to GAE or are you running it locally? Is it GAE Standard or Flexible? You say many logs are skipping - what else is skipping apart from what you are logging using console.log()? Are you talking about Stackdriver Monitoring when you say Logging console? Can you update the question by providing more details please? – Philipp Sh Aug 29 '18 at 13:49
  • @PhilippSh Can you please see my edited post. – Sudhanshu Gaur Aug 29 '18 at 13:55
  • I have just tested a NodeJS Flexible quickstart where I added a console.log() command and everything seems to be working fine. Is there a condition that needs to be fulfilled for the console.log() to be called? How do you know that there are supposed to be logs which are missing? Also, are you 100 % sure that these logs are not just displaced because of the huge number of other logs? Have you confirmed using Stackdriver Monitoring filters? – Philipp Sh Aug 30 '18 at 10:52
  • @PhilippSh 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. – Sudhanshu Gaur Aug 30 '18 at 13:19
  • @PhilippSh 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? – Sudhanshu Gaur Aug 30 '18 at 15:41

2 Answers2

6

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.

Sudhanshu Gaur
  • 7,486
  • 9
  • 47
  • 94
2

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.

Ying Li
  • 2,500
  • 2
  • 13
  • 37
  • I have already posted this question on Issue Tracker and they answered that they will ask with their product team. Also, about 0x module as I was starting 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. – Sudhanshu Gaur Sep 04 '18 at 10:07
  • 1
    I am awarding you bounty, at least for helping me otherwise, it will get wasted, Cheers :) – Sudhanshu Gaur Sep 06 '18 at 20:34