Bunyan is a simple and fast JSON logging library for node.js services and a CLI tool for nicely viewing those logs.
Questions tagged [bunyan]
115 questions
21
votes
4 answers
Log Rotation in Node.js?
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…

karthick
- 5,998
- 12
- 52
- 90
18
votes
7 answers
can I change the color of log data in winston?
I happened to use bunyan to log the the data . I wanted the logs be printed with appropriate colors like errors in red , debug yellow .. etc; unfortunately I couldn't find anyways to do that . And now I would like to know if its possible with…

srujana
- 501
- 2
- 6
- 13
14
votes
2 answers
Common logging for node, express application -- best practice?
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…

dewd
- 141
- 1
- 5
13
votes
1 answer
How to use Restify's RequestLogger?
RequestLogger
Sets up a child bunyan logger with the current request id filled in, along with any other parameters you define.
server.use(restify.requestLogger());
Registering the plugin does not log requests.

Gajus
- 69,002
- 70
- 275
- 438
11
votes
1 answer
bunyan log.child correct use case?
I've been looking at bunyan for logging in my nodejs app. I tried it out and everything seems to work pretty well. I had skipped over a section on log.child, but now I'm trying to understand how to use it. I think it's purpose is to allow me to…

rublex
- 1,893
- 5
- 27
- 45
9
votes
1 answer
Recommended way of applying Bunyan to a large node application?
I'm working on a node application with multiple modules. I am now trying to setup logging properly (should have done so at the start), and looking at using Bunyan.
Would it be better to have a single logger module that is exported and then required…

Philip O'Brien
- 4,146
- 10
- 46
- 96
8
votes
1 answer
How to handle log drains in one-off dynos?
We're aggregating our logs to papertrail using heroku's log drains. Everything works great, except, I'm not sure how to set up logging from one-off dynos, which we use to run scripts.
I thought the drain configuration would apply to one-off dynos,…

Paul Sanwald
- 10,899
- 6
- 44
- 59
7
votes
2 answers
Change bunyan log color for different levels
When using Bunyan, all my log levels use the same cyan color, like so:
Here is the Bunyan configuration we are using:
const bunyan = require('bunyan');
module.exports = bunyan.createLogger({name: 'cdt-api-server'});
My question is - how can I get…

Alexander Mills
- 90,741
- 139
- 482
- 817
7
votes
1 answer
VSCode Debug console customization
I've a project that i'm using Bunyan logger as logger agent. But the Bunyan logs with the json format the debug texts, and this make difficult to read the output:
But Bunyan provides a CLI tool to humanize the log that converts the JSON to a…

alvaropaco
- 1,573
- 18
- 29
6
votes
0 answers
Bunyan - duplicate logging in Node.js module
This logging duplication is happening in multiple projects and I am not sure why it's happening.
These two lines are logged:
[2016-01-25T21:28:25.019Z] INFO: SmartConnect/11555 on CACSVML-13295.local…

Alexander Mills
- 90,741
- 139
- 482
- 817
5
votes
0 answers
How do I send app logs to Elasticsearch from within a Dockerized Node app?
I have a small node script wherein I use bunyan to handle application logging. The logger writes to local storage. I'd like to send the logs to elasticsearch using filebeat (both of which are new tech to me).
I've made a dockerfile that…

Brandon
- 7,736
- 9
- 47
- 72
5
votes
0 answers
Winston log to array and flush to db in batch
Is there a transport or mechanism that allows for logging to an in-memory structure like array and then flush to db once a while?
dont want to make an expensive db call for every log and hence want to do the flush of logs as a batch once a while to…

ubreddy
- 815
- 2
- 8
- 19
5
votes
2 answers
Is it possible to use level value instead of number in bunyan log messages?
Bunyan-node logs are printed (to stdout) with numeric log levels, as defined in the bunyan doc (https://github.com/trentm/node-bunyan#levels )
{ ... , level: 10, .... }
Is it possible to print them with the actual value, in this case-
{ ... ,…

Mattan Bitner
- 1,463
- 3
- 14
- 29
5
votes
2 answers
How to display bunyan logs in the browser?
I have a server implemented on node.js and I use Bunyan for logging. Up until now when I need to debug issues I look at the logs in the Console, or open old log files with /bunyan/bin/bunyan . This is becoming far from ideal because I…

Dani C.
- 51
- 1
- 4
5
votes
1 answer
Benchmarking Node.js logging systems - am I missing some info on this?
I realized yesterday that most of the logging libraries for Node.js seem to use blocking/synchronous calls. Logging is normally an I/O operation, and with Node.js we are supposed to use non-blocking/asynchronous I/O everywhere possible.
console.log…

Alexander Mills
- 90,741
- 139
- 482
- 817