Google-cloud-node: How to activate debug logs of the API

Created on 19 Oct 2017  路  3Comments  路  Source: googleapis/google-cloud-node

Hi,

I m having some issue with the datastore API where the query hang without any responses. Here is a quick extract of my code:

var aGcpProjectName = '**********'
var datastore = require('@google-cloud/datastore')({
  projectId: aGcpProjectName,
  keyFilename: '/SAD/*********'
});

and later

log.info('Going to querry Google DataStore Service');
var query = me._dataStore.createQuery('BobStacks');
var aReturnPromise = me._dataStore.runQuery(query)
  .then((results) => {
    //Task entities found.
    const tasks = results[0];
    log.info('find all Google DataStore Over', results);
    if (tasks.length>0) {
      log.info('resolve');
      resolve(tasks);
    }
    else {
      log.info('Empty list when geting all from GDS.');
      resolve(null)
    }
  })
  .catch(function (err) {
    log.error('Error when findall. Error detail: ', err);
    reject(Error("It broke"));
  });

I see the first log "Going to querry Google DataStore Service" and nothing after that.

The interesting fact is that it seems to happen after 24 hours (if I restart the server after that it will works fine for some time until this happen again).

I would like to have more logs on the Datastore API itself and was thus wondering if there is a way to activate more logs for the library itself ? I check the FAQ and documentation but did not find the option.

For extra info here are the versions I use:

[root@stackviewer-1-n987w WebServerNodeJs]# node --version
v6.11.3

[root@stackviewer-1-n987w WebServerNodeJs]# npm list --depth=0
[email protected] /var/www/WebServerNodeJs
+-- @google-cloud/[email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]
question datastore

Most helpful comment

If Datastore is a gRPC API (and I think it is), the best way is to set these two environment variables:

  • GRPC_VERBOSITY: DEBUG
  • GRPC_TRACE: http

That should give you a substantial amount of debug output detailing every request and response going through the API.

All 3 comments

If Datastore is a gRPC API (and I think it is), the best way is to set these two environment variables:

  • GRPC_VERBOSITY: DEBUG
  • GRPC_TRACE: http

That should give you a substantial amount of debug output detailing every request and response going through the API.

@charly37 Datastore is a gRPC API, so those environment variables should work. If you discover anything that might be a bug of ours, please let us know.

Thx ! I will give it a try an open a dedicated ticket if I find something.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ddunkin picture ddunkin  路  3Comments

stephenplusplus picture stephenplusplus  路  3Comments

vvzen picture vvzen  路  4Comments

jmdobry picture jmdobry  路  3Comments

VikramTiwari picture VikramTiwari  路  3Comments