{"_id":"winston-zmq","_rev":"9-b80c9e8bf896fa4c6ba1f41ed8c63e8a","name":"winston-zmq","description":"A 0MQ transport for winston","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"winston-zmq","description":"A 0MQ transport for winston","version":"0.1.0","author":{"name":"David Henderson","email":"dhendo@gmail.com"},"contributors":[],"repository":{"type":"git","url":"git://github.com/TriggeredMessaging/winston-zmq.git"},"keywords":["logging","sysadmin","tools","winston","zmq","0mq","zeromq"],"dependencies":{"zmq":">=1.0.3"},"devDependencies":{"winston":"0.4.x","vows":"0.5.x","should":"0.3.x"},"main":"./lib/winston-zmq","scripts":{"test":"vows test/*-test.js"},"engines":{"node":">= 0.4.0"},"_npmUser":{"name":"dhendo","email":"dhendo@gmail.com"},"_id":"winston-zmq@0.1.0","_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.0","_defaultsLoaded":true,"dist":{"shasum":"815c36dff62550f810cbc1b7b8aac28985ea0642","tarball":"https://registry.npmjs.org/winston-zmq/-/winston-zmq-0.1.0.tgz","integrity":"sha512-BiN3xlQkIBCKugBoN+uFf5aGt5JTiTYxcSTiF/qCAeTlDYk+QRbpssz+QC3MnAf7WL0iQG27TsBNokyBSwZttg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID00CnjM52Sn6Tru517f3IH0ZjVJTYRrEZML6er+qPjWAiEA6Mssp53BsMwkd957Rf+ayGeUZP5sorxrywLDWl+ol9A="}]},"maintainers":[{"name":"dhendo","email":"dhendo@gmail.com"}]},"0.2.0":{"name":"winston-zmq","description":"A 0MQ transport for winston","version":"0.2.0","author":{"name":"David Henderson","email":"dhendo@gmail.com"},"contributors":[],"repository":{"type":"git","url":"git://github.com/TriggeredMessaging/winston-zmq.git"},"keywords":["logging","sysadmin","tools","winston","zmq","0mq","zeromq"],"dependencies":{"zmq":">=1.0.3"},"devDependencies":{"winston":"0.4.x","vows":"0.5.x","should":"0.3.x"},"main":"./lib/winston-zmq","scripts":{"test":"vows test/*-test.js"},"engines":{"node":">= 0.4.0"},"_npmUser":{"name":"dhendo","email":"dhendo@gmail.com"},"_id":"winston-zmq@0.2.0","_engineSupported":true,"_npmVersion":"1.1.0-beta-10","_nodeVersion":"v0.6.7","_defaultsLoaded":true,"dist":{"shasum":"402b673f8d0e8d32c7035ba4d3c5ff59662c9912","tarball":"https://registry.npmjs.org/winston-zmq/-/winston-zmq-0.2.0.tgz","integrity":"sha512-Op+Sv01r8r7S5pn4sVRgoI4hziRvwR7vua8CgxFFAage+tSV1J6todhVvjOpeOKJeMhFWrwSkdWpnDefy8/z4g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC1HvcN7HwfVbj3kCtUSVASVgiNz+n/WywlLHmTTMSEWAiAh6EhgZnKMpK+G7HajCXQ6OdPxe3IU1VisyODU9DsdHw=="}]},"maintainers":[{"name":"dhendo","email":"dhendo@gmail.com"}]},"0.2.1":{"name":"winston-zmq","description":"A 0MQ transport for winston","version":"0.2.1","author":{"name":"David Henderson","email":"dhendo@gmail.com"},"contributors":[],"repository":{"type":"git","url":"git://github.com/TriggeredMessaging/winston-zmq.git"},"keywords":["logging","sysadmin","tools","winston","zmq","0mq","zeromq"],"dependencies":{"zmq":">=1.0.3","winston":">=0.6.x"},"devDependencies":{"vows":"0.5.x","should":"0.3.x"},"main":"./lib/winston-zmq","scripts":{"test":"vows test/*-test.js"},"engines":{"node":">= 0.6.x"},"_npmUser":{"name":"dhendo","email":"dhendo@gmail.com"},"_id":"winston-zmq@0.2.1","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.24","_nodeVersion":"v0.6.19","_defaultsLoaded":true,"dist":{"shasum":"a8e5881e9ae83ed3dc2d39f9bf566de0ff6185ae","tarball":"https://registry.npmjs.org/winston-zmq/-/winston-zmq-0.2.1.tgz","integrity":"sha512-1H4yoHiDvMM5NqEiVMZYeK26wI9abzx6o/CdD73zHZrBR0+WYkeWPWtXuPMbU7b/WzTKTHWK4i6rJINp0KyhgQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGnQJ35xJ0LEbpnWF6rOcIKbMDSS/8Z3Wr1yYixHttF1AiEAmsNtPy/Bzjw0lyUVDZJqm4eaV4cxUUCrvs+Eu0wsLjI="}]},"maintainers":[{"name":"dhendo","email":"dhendo@gmail.com"}]}},"readme":"# winston\n\nA 0mq transport for [winston][0].\n\n## Installation\n\n### Installing npm (node package manager)\n\n``` bash\n  $ curl http://npmjs.org/install.sh | sh\n```\n\n### Installing winston-zmq\n\n``` bash\n  $ npm install winston\n  $ npm install winston-zmq\n```\n\n## Purpose\n\nThis winston transport allows you to publish logs using a 0mq pub socket (so that multiple recipients can subscribe to it)\n\nThe message is sent with a variable length prefix that allows the subscribers to subscribe log message of a certain threshold and above.\n\n## Usage\n``` js\n  var winston = require('winston');\n\n  //\n  // Requiring `winston-zmq` will expose\n  // `winston.transports.Zmq`\n  //\n  require('winston-zmq').Zmq;\n\n  winston.add(winston.transports.Zmq, options);\n```\n\nThe Zmq transport takes the following options. 'db' is required:\n\n\n* __transport:__ Transport to use for 0mq. (tcp|ipc|inproc|pgm|epgm)\n* __address:__ Address that the socket will bind to e.g. \"127.0.0.1\" or \"10.23.45.67\"\n* __separator:__ Separator to separate the level string from the JSON default |*|\n* __prefix:__ Prefix used to denote the log level\n* __prefixMapping:__ Mapping between log levels and prefix string length. Used if using custom log levels. e.g. { silly: 1, verbose: 2, info: 3, warn: 4, debug: 5, error: 6 }\n* __port:__ [required for tcp] : port to bind to when using the tcp transport  \n* __level:__ Level of messages that this transport should log.\n* __silent:__ Boolean flag indicating whether to suppress output.\n* __formatter:__ Optional formatter function to override the structure of the JSON data sent to the subscriber\n\n*Metadata:* Logged as a native JSON object.\n\n## Examples\n\n###Client \n```\nvar util = require('util'), zmq = require('zmq');\n\nvar socket = zmq.createSocket('sub');\nsocket.subscribe(''); // subscribe to all\n// socket.subscribe('***'); // subscribe to info and above\n\nsocket.on('message', function(bufMsg) {\n    var msg = bufMsg.toString('utf8');\n    try {\n        var message = msg.split('|*|')[1];\n        oMessage = JSON.parse(message);\n        console.log(oMessage);\n    } catch(err) {\n        console.log(err);\n    }\n});\n\nsocket.connect(\"tcp://127.0.0.1:7890\");\n```\n\n### Log Source\n\n```\nvar winston = require('winston');\nvar Zmq = require('../lib/winston-zmq.js').Zmq;\nvar transports = {};\n\n// Set up the zmq transport\ntransports.Zmq = new Zmq({level : 'silly',port: 7890});\n\n// Instantiate out logger.\nvar logger = new (winston.Logger)({transports : [transports.Zmq]});\n\nlogger.log('silly', 'Some Text', {somekey: 'some data'});\nlogger.log('error', 'Some Text', {somekey: 'some data'});\n```\n\n### Message Format\n\nThe above two messages will be transmitted as:\n\n```\n*|*|{\"timestamp\":\"2011-11-16T15:53:55.912Z\",\"level\":\"silly\",\"message\":\"Some Text\",\"meta\":{\"somekey\":\"some data\"}}\n```\n\n```\n******|*|{\"timestamp\":\"2011-11-16T15:53:55.913Z\",\"level\":\"error\",\"message\":\"Some Text\",\"meta\":{\"somekey\":\"some data\"}}\n```\n\n\n\n\n\n#### Author: [David Henderson](http://twitter.com/@DHDev)\n\n[0]: https://github.com/indexzero/winston","maintainers":[{"name":"dhendo","email":"dhendo@gmail.com"}],"time":{"modified":"2022-06-29T02:30:57.004Z","created":"2011-11-17T08:58:02.697Z","0.1.0":"2011-11-17T08:58:03.983Z","0.2.0":"2012-01-31T16:07:09.819Z","0.2.1":"2012-06-29T08:01:52.265Z"},"author":{"name":"David Henderson","email":"dhendo@gmail.com"},"repository":{"type":"git","url":"git://github.com/TriggeredMessaging/winston-zmq.git"}}