flatiron/winston — Issue #86: CouchDB Transport Broken (Quick Fix! :D)
Author: gschier
Created: 2012-01-25 05:28:52+00:00
State: open

There is a small bug in the Couchdb transport file that can be easily fixed.

If you change like 69 in the couchdb transport to :

message = common.clone(meta || {}),

it fixes the issue. This was taken straight from the Loggly transport.

I'm new to GitHub and can't figure out how to send a pull request (maybe I need to be a collaborator?), but this is a pretty easy fix.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR MESSAGE:
/home/gschier/workspace/forkjoy/api/node_modules/winston/lib/winston/transports/couchdb.js:73

message.level = level;

^

TypeError: Cannot set property 'level' of null
at [object Object].log (/home/gschier/workspace/forkjoy/api/node_modules/winston/lib/winston/transports/couchdb.js:73:17)
at [object Object].log (/home/gschier/workspace/forkjoy/api/node_modules/winston/lib/winston/logger.js:170:17)
at [object Object].info (/home/gschier/workspace/forkjoy/api/node_modules/winston/lib/winston/common.js:44:21)
at /home/gschier/workspace/forkjoy/api/controllers/api.js:74:14
at /home/gschier/workspace/forkjoy/api/models/item.js:83:12
at IncomingMessage. (/home/gschier/workspace/forkjoy/api/node_modules/cradle/lib/cradle.js:252:21)
at IncomingMessage.emit (events.js:88:20)
at HTTPParser.onMessageComplete (http.js:137:23)
at Socket.ondata (http.js:1124:24)
at TCP.onread (net.js:348:27)