Skip to content

Commit

Permalink
print aliases to a string when logging
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Jul 15, 2020
1 parent 7e31d98 commit 04441f1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/es_archiver/lib/indices/create_index_stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/

import { Transform, Readable } from 'stream';
import { inspect } from 'util';

import { get, once } from 'lodash';
import { Client } from 'elasticsearch';
import { ToolingLog } from '@kbn/dev-utils';
Expand Down Expand Up @@ -88,8 +90,9 @@ export function createCreateIndexStream({
err?.body?.error?.reason?.includes('index exists with the same name as the alias') &&
attemptNumber < 3
) {
const aliasStr = inspect(aliases);
log.info(
`failed to create aliases [${aliases}] because ES indicated an index/alias already exists, trying again`
`failed to create aliases [${aliasStr}] because ES indicated an index/alias already exists, trying again`
);
await attemptToCreate(attemptNumber + 1);
return;
Expand Down

0 comments on commit 04441f1

Please sign in to comment.