-Parameterized elastic search logging to a const.

This commit is contained in:
Mark Beamer Jr 2018-05-26 22:49:29 -04:00
parent bb8525f69e
commit 78e26b2e6e

View file

@ -13,12 +13,13 @@ import fs from 'fs';
import fileExists from 'file-exists'; import fileExists from 'file-exists';
import * as util from '../../utils/importer/util'; import * as util from '../../utils/importer/util';
const loggerStream = winstonStream(winston, 'info'); const elasticsearchloglevel = 'info';
const loggerStream = winstonStream(winston, elasticsearchloglevel);
const eclient = new elasticsearch.Client({ const eclient = new elasticsearch.Client({
host: 'http://localhost:9200', host: 'http://localhost:9200',
log: { log: {
level : 'info', level : elasticsearchloglevel,
type : 'stream', type : 'stream',
stream: loggerStream, stream: loggerStream,
}, },