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
2
votes
0 answers
Formatting logs in GCP with node bunyan
I trying to understand formatting in GCP and using Bunyan and couldn't find any good solution. I created a logger in my app.
import * as bunyan from 'bunyan';
import { LoggingBunyan } from '@google-cloud/logging-bunyan';
const…

MarJano
- 1,257
- 2
- 18
- 39
2
votes
1 answer
How would i write a test for something which uses stdout?
I'm trying to improve test coverage on this file
'use strict'
/**
* Returns the logging options we're using
*
* @param {String} name Name of the logger. Should be service name. e.g. ciitizen-file-service
* @returns {Object} The logging…

Catfish
- 18,876
- 54
- 209
- 353
2
votes
1 answer
@sentry/node integration to wrap bunyan log calls as breadcrumbs
Sentry by defaults has integration for console.log to make it part of breadcrumbs:
Link: Import name: Sentry.Integrations.Console
How can we make it to work for bunyan logger as well, like:
const koa = require('koa');
const app = new koa();
const…

Zeeshan Hassan Memon
- 8,105
- 4
- 43
- 57
2
votes
1 answer
Adding custom level to bunyan instance
I have created a logger instance of bunyan
export const createLogger = (
appname: string,
) =>
bunyan.createLogger({
name: appname,
streams: [
{
level: 'error',
stream: process.stdout
},
],
})
After…

Aayushi
- 1,736
- 1
- 26
- 48
2
votes
2 answers
How to add custom JSON objects in Node.js Bunyan Logging?
I have few questions about Node.js Bunyan logging. I'm kinda new the bunyan logging, so please I apologize if i ask any laymen questions.
I'm trying to stream bunyan log output in json format. Primarily in a file and I have plans to stream it a…

saz
- 955
- 5
- 15
- 26
2
votes
1 answer
Wrapper over bunyan logging library
I know it's a very abstract question, but I just don't know where/how to start.
I am using bunyan as a logging library in my app. This is a sample syntax for logging something:
const log = bunyan.createLogger({...});
log.info(...);
…

Milkncookiez
- 6,817
- 10
- 57
- 96
2
votes
1 answer
print bunyan middleware reqId in all logs
I am developing a RESTful service using node,express and bunyan middleware.
Bunyan middleware is generating a UUID and the same is available at req.reqId. So, when the logging is happening via req.log.info("log message") then the reqId is being…

swathi yakkali
- 143
- 8
2
votes
0 answers
Request specific logging using Bunyan
I am using bunyan for logging service in my express-nodeJS application. I want to log per user/per request logging so that flow of request can be tracked down easily and will be easier to debug and keep a check on response time.
I am thinking to…

Krrish Raj
- 1,505
- 12
- 28
2
votes
1 answer
Logging query string with express-bunyan-logger and graphql
I've made a short, self contained example of a problem I'm having with express-bunyan-logger.
I'm trying to add express-bunyan-logger as middleware, and utilize includesFn to log the query string and body as a custom fields.
const app =…

Paul Sanwald
- 10,899
- 6
- 44
- 59
2
votes
1 answer
Is it possible to override bunyan's log functions?
I'm using bunyan.js as my logging solution and I would like to add functionality to it's logging functions.
For example I would like to send something to a third party API each time there's a call to log.fatal()
Is that possible? I looked through…

Tzvika Mordoch
- 191
- 2
- 13
2
votes
1 answer
Catch exceptions with bunyan
I am using bunyan for logging my node.js code.
But I was wondering is there anything like winston's ExceptionHandlers:[] in bunyan?

Shipra
- 1,259
- 2
- 14
- 26
2
votes
1 answer
nodejs bunyan order of elements
I'm using bunyan, and this is an example of what i'm writting in my log.
Is there a way to change the order of the fields printed? from…

antonio
- 477
- 7
- 18
2
votes
0 answers
Bunyan stream takes 100% cpu when target is down
I'm using "bunyan-redis" (already posyted an issue there) in order to send all my logs to a redis broker.
When the redis broker got full and couldn't accept more input logs, the node app started working at 100% CPU, and couldn't accept any…

skme
- 731
- 6
- 24
2
votes
2 answers
Getting ECONNREFUSED error in nodejs when logstash server disconnects
I am using node-bunyan and bunyan-logstash-tcp in my nodejs application to send the logs to logstash (1.4.2) and elasticsearch (1.4.2).
Whenever the logstash server disconnects or is not reachable, my nodejs application crashes giving the following…

DShah
- 472
- 5
- 15
2
votes
1 answer
Formatting output in bunyan logging
I am experimenting on node bunyan module. As a part of it I would like to know some facts regarding bunyan..
Does bunyan facilitate a way to change the order of the contents printed on bunyan logs. For example by default timestamp will be printed…

user3007385
- 153
- 4
- 15