Skip to content

Commit

Permalink
Fixes issue with default transport not beeing properly set
Browse files Browse the repository at this point in the history
  • Loading branch information
qejk committed Apr 27, 2016
1 parent 8e37499 commit 971bd8a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions source/server/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ Space.Module.define('Space.logging.Winston', {

onInitialize() {
const log = this.injector.get('log');
const transports = lodash.get(this.configuration, 'log.winston.transports', [
this._setupWinstonConsoleTransport()
]);
let transports = lodash.get(this.configuration, 'log.winston.transports', []);
if (lodash.isEmpty(transports)) {
transports = [this._setupWinstonConsoleTransport()]
}

const adapter = new Space.Logger.WinstonAdapter(transports);
this.injector.map('Space.Logger.WinstonAdapter').toStaticValue(adapter);
log.addAdapter('winston', adapter);
Expand Down

0 comments on commit 971bd8a

Please sign in to comment.