Browse Source

Merge pull request #422 from vesameskanen/log-queries

Add query/response logging in debug mode to place controller, too
pull/320/merge
Julian Simioni 9 years ago
parent
commit
59c030e76f
  1. 4
      controller/place.js

4
controller/place.js

@ -1,4 +1,5 @@
var service = { mget: require('../service/mget') }; var service = { mget: require('../service/mget') };
var logger = require('pelias-logger').get('api:controller:place');
function setup( backend ){ function setup( backend ){
@ -46,6 +47,8 @@ function setup( backend ){
}; };
}); });
logger.debug( '[ES req]', JSON.stringify(query) );
service.mget( backend, query, function( err, docs ) { service.mget( backend, query, function( err, docs ) {
// error handler // error handler
@ -56,6 +59,7 @@ function setup( backend ){
else { else {
res.data = docs; res.data = docs;
} }
logger.debug('[ES response]', JSON.stringify(docs));
next(); next();
}); });

Loading…
Cancel
Save