Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improved logging of batch indexing errors #114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
"tape": "^4.4.0"
},
"dependencies": {
"elasticsearch": "^16.0.0",
"@hapi/joi": "^15.0.0",
"elasticsearch": "^16.0.0",
"lodash": "^4.17.15",
"pelias-config": "^4.0.0",
"pelias-logger": "^1.2.1",
"through2": "^3.0.0"
Expand Down
6 changes: 6 additions & 0 deletions src/transaction.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const _ = require('lodash');
const pelias_logger = require( 'pelias-logger' );

var max_retries = 5;
Expand Down Expand Up @@ -62,6 +63,11 @@ function wrapper( client, parent_logger ){

if( task.status > 201 ){
logger.error( '[' + action.status + ']', action.error );

// additional debugging output of the error and corresponding request
var req = batch._slots.filter(s => _.get(s, 'cmd.index._id') === action._id);
logger.info(JSON.stringify(action, null, 2));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about the warn level? That implies the output is related to a problem much more than info.

logger.info(JSON.stringify(req, null, 2));
}
// else {
// delete task.cmd; // reclaim memory
Expand Down