bunyan

Common logging for node, express application — best practice?

戏子无情 提交于 2019-12-18 19:05:17
问题 I'm working on an node.js application with several dozen modules and using bunyan for logging (JSON output, multiple configurable streams). I've been looking for good examples of how to implement a instance across all the modules, but haven't seen what appears to be a really clean example I can learn from. Below illustrates an approach that works, but seems quite inelegant (ugly) to me. I'm new to node & commonjs javascript in general, so looking for recommendations on how to improve it.

Debugging breaks on launch with bunyan.createLogger - Node v5.8

牧云@^-^@ 提交于 2019-12-11 07:34:31
问题 When I try to launch a node.js app using bunyan, the debugger stops once I try to create the logger. When I step through the code, I can drill into createLogger and find where it breaks. In node_modules/bunyan/lib, the debugger detaches on line 579 - assert.ok(isWritable(s.stream), '"stream" stream is not writable: ' + util.inspect(s.stream)); The debugger works until I set logger, after that it detaches and I can never step to the logger.info line. import bunyan from 'bunyan'; const logger =

Separate info and error logs bunyan

六眼飞鱼酱① 提交于 2019-12-11 04:39:30
问题 As I have seen many logs in blogs and I find bunyan suitable for logging but there is problem with it that it can't log to file according to their level. Below is code structure I am following const RotatingFileStream = require('bunyan-rotating-file-stream'); const bunyan = require('bunyan'); var log = bunyan.createLogger({ name: 'ShotPitch', streams: [{ name: 'info', level: 'info', stream: new RotatingFileStream({ path: 'info.%d-%b-%y.log', period: '1d', // daily rotation totalFiles: 10, //

Log Rotation in Node.js?

廉价感情. 提交于 2019-11-28 23:16:42
In my web analytics, I am logging the data in plain text file. I want to rotate the log on a daily basis because its logging too much data. Currently I am using bunyan to rotate the logs. Problem I am facing It is rotating the file correctly, but rotated log file are in the name log.0 , log.1 , etc. I want the file name to be log.05-08-2013 , log.04-08-2013 I can't edit the source of the bunyan package because we are installing the modules using package.json via NPM. So my question is - Is there any other log rotation in Node.js that meets my requirement? Timothy Strimple Winston does support

Log Rotation in Node.js?

為{幸葍}努か 提交于 2019-11-27 14:38:41
问题 In my web analytics, I am logging the data in plain text file. I want to rotate the log on a daily basis because its logging too much data. Currently I am using bunyan to rotate the logs. Problem I am facing It is rotating the file correctly, but rotated log file are in the name log.0 , log.1 , etc. I want the file name to be log.05-08-2013 , log.04-08-2013 I can't edit the source of the bunyan package because we are installing the modules using package.json via NPM. So my question is - Is