diff --git a/lib/winston/logger.js b/lib/winston/logger.js index a3f60a7ae..89dd4aca7 100644 --- a/lib/winston/logger.js +++ b/lib/winston/logger.js @@ -238,7 +238,7 @@ class Logger extends Transform { message: msg }); - if (meta.message) info.message += `${meta.message}`; + if (meta.message) info.message = `${info.message} ${meta.message}`; if (meta.stack) info.stack = meta.stack; this.write(info); diff --git a/test/formats/errors.test.js b/test/formats/errors.test.js index 0364a469a..c3ff7bdcf 100644 --- a/test/formats/errors.test.js +++ b/test/formats/errors.test.js @@ -110,7 +110,7 @@ describe('format.errors (integration)', function () { format.printf(info => info.message) )); - logger.log('info', 'Caught error: ', new Error('Errors lack .toJSON() lulz')); + logger.log('info', 'Caught error:', new Error('Errors lack .toJSON() lulz')); }); it('logger.log(level, msg, meta) [custom error properties]', (done) => { @@ -132,7 +132,7 @@ describe('format.errors (integration)', function () { format.printf(info => info.message) )); - logger.log('info', 'Caught error: ', err); + logger.log('info', 'Caught error:', err); }); it('logger.(error)', (done) => { @@ -209,7 +209,7 @@ describe('format.errors (integration)', function () { format.printf(info => info.message) )); - logger.info('Caught error: ', new Error('Errors lack .toJSON() lulz')); + logger.info('Caught error:', new Error('Errors lack .toJSON() lulz')); }); it('logger.(msg, meta) [custom error properties]', (done) => { @@ -231,7 +231,7 @@ describe('format.errors (integration)', function () { format.printf(info => info.message) )); - logger.info('Caught error: ', err); + logger.info('Caught error:', err); }); it(`Promise.reject().catch(logger.)`, (done) => {