Skip to content

improved logging of batch indexing errors#114

Open
missinglink wants to merge 1 commit intomasterfrom
batch_indexing_error_logging
Open

improved logging of batch indexing errors#114
missinglink wants to merge 1 commit intomasterfrom
batch_indexing_error_logging

Conversation

@missinglink
Copy link
Member

@missinglink missinglink commented Oct 31, 2019

today I was debugging a batch indexing error and wasn't able to get enough information about the request in order to reproduce it.

this PR adds additional logging under the info log level which provides extended info about the error message and the original request.

I chose info because there is a lot going on in verbose so I wanted something between that and error (and info is the only option).

Also added lodash so I could use _.get() for safety reasons.

@missinglink missinglink changed the title improved logging of batch indexing error improved logging of batch indexing errors Oct 31, 2019

// 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments