diff --git a/lib/winston-loggly.js b/lib/winston-loggly.js index bfeb73a..1f71060 100644 --- a/lib/winston-loggly.js +++ b/lib/winston-loggly.js @@ -9,6 +9,7 @@ var events = require('events'), loggly = require('loggly'), util = require('util'), + cycle = require('cycle'), winston = require('winston'), Stream = require('stream').Stream; @@ -95,6 +96,8 @@ Loggly.prototype.log = function (level, msg, meta, callback) { meta.timestamp = (new Date()).toISOString(); } + meta = meta !== null && meta !== undefined && !(meta instanceof Error) ? cycle.decycle(meta) : meta || null; + if (this.stripColors) { msg = ('' + msg).replace(code, ''); } diff --git a/package.json b/package.json index 797c7e3..c264500 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ }, "keywords": ["logging", "sysadmin", "tools"], "dependencies": { - "loggly": "~1.1.0" + "loggly": "~1.1.0", + "cycle": "1.0.x" }, "devDependencies": { "winston": "1.0.x",