Skip to content

Commit

Permalink
Removing automagic call add ELK
Browse files Browse the repository at this point in the history
  • Loading branch information
jonwinton committed Jun 23, 2017
1 parent 0f1132b commit dca674c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 0 additions & 2 deletions lib/services/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ winston.add(winston.transports.Console, {
});
winston.default.transports.console.level = logLevel;

addELK(process.env.CLAY_ELK); // CLAY_ELK=domain.com:9200

/**
* @param {*} obj
* @returns {boolean}
Expand Down
14 changes: 12 additions & 2 deletions lib/services/log.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ describe(dirname, function () {
beforeEach(function () {
sandbox = sinon.sandbox.create();
sandbox.stub(winston);

});

afterEach(function () {
sandbox.restore();
winston.transports.Logstash = undefined;
});

describe('withStandardPrefix', function () {
Expand Down Expand Up @@ -70,5 +68,17 @@ describe(dirname, function () {
sinon.assert.calledOnce(winston.log);
});
});

describe('addELK', function functionName() {
const fn = lib[this.title];

it('does not call winston.add if Logstash is already defined', function () {
winston.transports.Logstash = true;
fn('domain.com:1010');

sinon.assert.notCalled(winston.add);
});
});

});
});

0 comments on commit dca674c

Please sign in to comment.