Commit 9f96df237a5e0f31f3afdf6198662605a23d49ea
1 parent
cf6aa22fba
Exists in
master
logging
Showing 1 changed file with 7 additions and 7 deletions Side-by-side Diff
xmlrpc-server.js
... | ... | @@ -151,7 +151,7 @@ function composeXmlRpcResponse(param) { |
151 | 151 | } |
152 | 152 | } |
153 | 153 | |
154 | - logger.info(JSON.stringify(data)); | |
154 | + //logger.info(JSON.stringify(data)); | |
155 | 155 | |
156 | 156 | return xml2jsBuilder.buildObject(data); |
157 | 157 | } |
... | ... | @@ -296,7 +296,7 @@ function sendReply(response) { |
296 | 296 | }); |
297 | 297 | } |
298 | 298 | |
299 | -function errorOnTopUpReport(topUpReportError) { | |
299 | +function errorOnTopUpReport(topUpReportError, debugInfo) { | |
300 | 300 | var hasError = false; |
301 | 301 | |
302 | 302 | if (!topUpReportError) { |
... | ... | @@ -305,14 +305,14 @@ function errorOnTopUpReport(topUpReportError) { |
305 | 305 | |
306 | 306 | try { |
307 | 307 | if (topUpReportError.body) { |
308 | - logger.verbose('errorOnTopUpReport response body: ' + topUpReportError.body); | |
308 | + logger.verbose('errorOnTopUpReport response body: ' + topUpReportError.body, {req: debugInfo}); | |
309 | 309 | } |
310 | 310 | |
311 | - if (topUpReportError.res && topUpReportError.res.statusCode) { | |
312 | - logger.verbose('Partner response with status code:' + topUpReportError.res.statusCode); | |
311 | + if (topUpReportError.res && topUpReportError.res.statusCode && topUpReportError.res.statusCode != '200') { | |
312 | + logger.verbose('Partner response with status code:' + topUpReportError.res.statusCode, {req: debugInfo}); | |
313 | 313 | |
314 | 314 | if (topUpReportError.res.statusCode != '200') { |
315 | - logger.warn('Going to resend topUpReport because status code is not 200 (' + topUpReportError.res.statusCode + ')'); | |
315 | + logger.warn('Going to resend topUpReport because status code is not 200 (' + topUpReportError.res.statusCode + ')', {req: debugInfo}); | |
316 | 316 | return true; |
317 | 317 | } |
318 | 318 | } |
... | ... | @@ -380,7 +380,7 @@ function sendTopUpReport(reverseUrls, params, urlIdx, retry) { |
380 | 380 | |
381 | 381 | client.methodCall(methodName, [ params ], function (topUpReportError, value) { |
382 | 382 | |
383 | - if (errorOnTopUpReport(topUpReportError)) { | |
383 | + if (errorOnTopUpReport(topUpReportError, {params: params, clientOptions: clientOptions})) { | |
384 | 384 | |
385 | 385 | logger.warn('Error sending topUpReport retrying another url (if available): ' + topUpReportError, {error: topUpReportError.toString()}); |
386 | 386 | sendTopUpReport(reverseUrls, params, ++urlIdx, retry); |