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
1
vote
1 answer
How to use bunyan serializers
I'm trying to use a custom serializer but it doesn't seem to work for me, my serializer is never called. What am I doing wrong?
I create a logger like this:
const mask = token => {
console.log({token})
return typeof token === 'string' ?…

Lev Kuznetsov
- 3,520
- 5
- 20
- 33
1
vote
1 answer
How to save pipe through bunyan CLI tool logs to log file instead of json format
How I can save logs generated by bunyan CLI tool by using command to run server node . | bunyan
to server.log instead of json format in server.log file.
On console logs:-
[2018-05-14T12:28:01.465Z] INFO: sampleApplication/12840:…

Rishi Mahendru
- 11
- 3
1
vote
1 answer
Capture bunyan logs / Peek into bunyan logger
I have a function, which uses bunyan logger passed to it for logging.
The global logger is used across the whole application to provide logging facilities for many components. This way we have a centralized log. Most of the time we just pass this…

Slava Fomin II
- 26,865
- 29
- 124
- 202
1
vote
2 answers
How do I bind a bunyan logging function to a class function in ES6?
Fussing with this one a bit today, still getting an error. Docs here. Closest I have is this:
constructor(region, sslEnabled = true,
logger = () => {}, errorLogger = () => {}) {
if (region === undefined || !region)
throw new…

jcollum
- 43,623
- 55
- 191
- 321
1
vote
0 answers
How can I clean up multi-line Bunyan log output that is coming over an ssh connection?
ssh -t -i ~/work/keys/somekey.pem ec2-user@x.x.x.x 'docker logs --follow --tail 50 -t taggoeshere' | cut -c 32- | bunyan -o short
This works well for single line docker log output:
12:54:49.038 INFO xxxxxxxxxxx: Failed message, sending to S3…

jcollum
- 43,623
- 55
- 191
- 321
1
vote
2 answers
Separate info and error logs bunyan
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 =…

raj
- 388
- 5
- 24
1
vote
0 answers
What are the bestway to optimize bunyan logger in node.js production environment?
We are using bunyan logger to log messages in Node.js v4.2.4 environment. In production we use "error" log levels only. Below is an example of using logger in code.
logger.error("Error getting database connection, %s", err);
Here the "err" is the…

Sahan Maldeniya
- 1,028
- 1
- 14
- 21
1
vote
1 answer
Bunyan with webpack - trying to access fs which has been shimmed
I am trying to setup bunyan in my webpack based application.
I have the following webpack configuration:
// these shims are needed for bunyan
alias: {
'dtrace-provider': path.resolve('empty-shim.js'),
"fs":…

mangusbrother
- 3,988
- 11
- 51
- 103
1
vote
2 answers
How to integrate bunyan logs with google cloud stackdriver
My app is hosted in gcloud app engine and generates bunyan logs. I'm looking for guidance to ship those logs to stackdriver and leverage stackdriver capabilities monitoring, logging and dashboards.. appreciate any pointers.

Sahas
- 3,046
- 6
- 32
- 53
1
vote
2 answers
how do I filter a bunyan log based on date?
Got a bunyan log, here's a sample entry
[2016-05-31T15:38:47.889Z] FATAL: jklajsd-utilities/23399 on aaa.bbb.ccc.com:
0: {
"code": "EADDRINUSE",
"errno": "EADDRINUSE",
"syscall": "listen",
"address": "0.0.0.0",
…

jcollum
- 43,623
- 55
- 191
- 321
1
vote
1 answer
Debugging breaks on launch with bunyan.createLogger - Node v5.8
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…

VtoCorleone
- 16,813
- 5
- 37
- 51
1
vote
2 answers
Show debug messages in console in bunyan
child.log.info('info');
child.log.debug('debug');
I use the following command:
node app.js | bunyan -o short -l debug
However it only shows INFO. Does not show DEBUG. I'd like ot display debug messages in the console, what am i doing wrong?

basickarl
- 37,187
- 64
- 214
- 335
1
vote
0 answers
Filtering PHI data when logging with bunyan (nodejs)
When logging an object (JSON object with many data elements), how can we filter PHI data and not log them
e.g SSN, Creditcard etc
Are there any available solutions which filter this, or allow to configure such filters.

neel
- 243
- 6
- 17
1
vote
1 answer
Bunyan higher levels logging into lower level streams
I am trying to use bunyan in my nodejs application, however I stuck with this bizarre behaviour.
Defining the logger like so:
var info = bunyan.createLogger({
name: 'Test',
streams: [
{
path: './logger/fatal.log',
…

Anuroop Kuppam
- 167
- 8
1
vote
1 answer
Is it possible to use the bunyan cli formatter to process logback logs?
My logback logs from a Java app are generated in json format. The node service is generating json logs via bunyan. Is it possible to use the buynan cli on the logback log stream to make the those logs human readable like the cli can for the node…

claya
- 1,920
- 1
- 18
- 32