Browse Source

fix(elasticsearch-plugin): Improve error log when search indexing fails

Relates to #1556
Michael Bromley 3 years ago
parent
commit
7dcad6ee6b

+ 2 - 1
packages/elasticsearch-plugin/src/indexing/elasticsearch-index.service.ts

@@ -13,6 +13,7 @@ import {
 } from '@vendure/core';
 import { Observable } from 'rxjs';
 
+import { loggerCtx } from '../constants';
 import { UpdateIndexQueueJobData } from '../types';
 
 import { ElasticsearchIndexerController, ReindexMessageResponse } from './indexer.controller';
@@ -161,7 +162,7 @@ export class ElasticsearchIndexService implements OnApplicationBootstrap {
                     });
                 },
                 error: (err: any) => {
-                    Logger.error(JSON.stringify(err));
+                    Logger.error(err.message || JSON.stringify(err), loggerCtx, err.stack);
                     reject(err);
                 },
             });