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

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.

None yet

2 participants