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

Feature/add query logging #3281

Open
wants to merge 2 commits into
base: v6/develop
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
4 changes: 3 additions & 1 deletion src/commands/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ class Command {
* @returns {*}
*/
async handleError(operationId, blockchain, errorMessage, errorName, markFailed) {
this.logger.error(`Command error (${errorName}): ${errorMessage}`);
this.logger.error(
`Command with operationId: ${operationId}, error (${errorName}): ${errorMessage}`,
);
if (markFailed) {
await this.operationIdService.updateOperationIdStatus(
operationId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ class QueryController extends BaseController {
}

async handleRequest(req, res) {
const { query, type: queryType } = req.body;
const { query, type: queryType, repository } = req.body;

const operationId = await this.operationIdService.generateOperationId(
OPERATION_ID_STATUS.QUERY.QUERY_INIT_START,
);

this.logger.info(
`Received query request, query: ${query}, queryType: ${queryType}, repository: ${repository}, operationId: ${operationId}`,
);

this.returnResponse(res, 202, {
operationId,
});
Expand Down
Loading