node-bunyan | a simple and fast JSON logging module for node.js services

 by   trentm JavaScript Version: 2.0.5 License: Non-SPDX

kandi X-RAY | node-bunyan Summary

kandi X-RAY | node-bunyan Summary

node-bunyan is a JavaScript library typically used in Logging, Nodejs applications. node-bunyan has no bugs, it has no vulnerabilities and it has medium support. However node-bunyan has a Non-SPDX License. You can install using 'npm i yqg-bunyan' or download it from GitHub, npm.

Bunyan is a simple and fast JSON logging library for node.js services:.

            kandi-support Support

              node-bunyan has a medium active ecosystem.
              It has 7012 star(s) with 537 fork(s). There are 119 watchers for this library.
              It had no major release in the last 6 months.
              There are 223 open issues and 262 have been closed. On average issues are closed in 322 days. There are 60 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of node-bunyan is 2.0.5

            kandi-Quality Quality

              node-bunyan has 0 bugs and 0 code smells.

            kandi-Security Security

              node-bunyan has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              node-bunyan code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              node-bunyan has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              node-bunyan releases are not available. You will need to build from source code and install.
              Deployable package is available in npm.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed node-bunyan and discovered the below as its top functions. This is intended to give you an instant insight into node-bunyan implemented functionality, and help decide if they suit your requirements.
            • Creates a new Logger instance .
            • Create a new log record
            • creates a log event ember for log level
            • Returns a trace object containing the caller information .
            • Move file recursively .
            • Stringify a single record
            • Resolve a level
            • Create a replacer function .
            • Create a new object .
            • Construct a new MUT instance
            Get all kandi verified functions for this library.

            node-bunyan Key Features

            No Key Features are available at this moment for node-bunyan.

            node-bunyan Examples and Code Snippets

            npmdot img1Lines of Code : 43dot img1no licencesLicense : No License
            copy iconCopy
            $ npm install browserify bunyan
            var bunyan = require('bunyan');
            var log = bunyan.createLogger({name: 'play', level: 'debug'});
            log.trace('this one does not emit');
            log.debug('hi on debug');   // console.log
  'hi on info');     //  
            node-bunyan - mute by envvars stream
            JavaScriptdot img2Lines of Code : 58dot img2License : Non-SPDX
            copy iconCopy
             * Example of a MuteByEnvVars Bunyan stream to mute log records matching some
             * envvars. I.e. as a way to do:
             * outside of core.
            node-bunyan - specific level streams
            JavaScriptdot img3Lines of Code : 51dot img3License : Non-SPDX
            copy iconCopy
            #!/usr/bin/env node
             *  was a request to have
             * bunyan core support logging some levels to one stream and others to another,
             * *not* limited by bunyan's current support that a stream `level` implies
             * "that level and higher".
             * Let's do th  
            node-bunyan - rot specific levels
            JavaScriptdot img4Lines of Code : 51dot img4License : Non-SPDX
            copy iconCopy
            var bunyan = require('./'),
                safeCycles = bunyan.safeCycles;
            var util = require('util');
            function SpecificLevelStream(levels, stream) {
                var self = this;
                this.levels = {};
                levels.forEach(function (lvl) {
            Change bunyan log color for different levels
            Lines of Code : 30dot img5License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            var colors = require('colors');
            var bunyan = require('bunyan');
            function MyRawStream() {}
            MyRawStream.prototype.write = function (rec) {
                console.log('[%s] %s: %s',
            winston format info objects differently
            Lines of Code : 14dot img6License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            const bunyan = require('bunyan')
            const serializers = {
              valuesWithIds: vals => => v.value)
            const logger = bunyan.createLogger({ name: 'root', level: 'error' })
            const valuesWithIds = [{ id: 1, value: 'a' }, { id: 1, val
            How to add custom JSON objects in Node.js Bunyan Logging?
            Lines of Code : 57dot img7License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            var bunyan = require('bunyan');
            function modifiedStream(filePath) {
              return {
                write: log => {
                  log.level = bunyan.nameFromLevel[log.level];
                  log.time = new Date().valueOf();
                  log._timeStamp = new Date().toISOString(
            Wrapper over bunyan logging library
            Lines of Code : 41dot img8License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            const bunyan = require( "bunyan" ),
                  stream = require( "stream" );
            class MyStream extends stream.Writable {
                 * When we have a record from bunyan
                write( record ) {
                        console.log( "-----> ", record
            if I try bunyan.createLogger my application doesn't start and doesn't show error
            Lines of Code : 6dot img9License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            "bunyan": "^1.8.8"
            var bunyan = require('bunyan');
            var log = bunyan.createLogger({name: "myapp"});

            Community Discussions


            @sentry/node integration to wrap bunyan log calls as breadcrumbs
            Asked 2018-Nov-15 at 04:26

            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:



            Answered 2018-Nov-15 at 04:26

            Bunyan supports custom streams, and those streams are just function calls. See

            Below is an example custom stream that simply writes to the console. It would be straight forward to use this example to instead write to the Sentry module, likely calling Sentry.addBreadcrumb({}) or similar function.

            Please note though that the variable record in my example below is a JSON string, so you would likely want to parse it to get the log level, message, and other data out of it for submission to Sentry.



            Exporting a type from another module with all type info
            Asked 2018-Oct-22 at 11:13

            I have a module that contains one export. It's a factory function to create a bunyan logger:



            Answered 2018-Oct-22 at 11:13

            I found the solution myself. As bunyan exports a namespace, I had to change my index.ts to:


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install node-bunyan

            Tip: The bunyan CLI tool is written to be compatible (within reason) with all versions of Bunyan logs. Therefore you might want to npm install -g bunyan to get the bunyan CLI on your PATH, then use local bunyan installs for node.js library usage of bunyan in your apps. Tip: Installing without optional dependencies can dramatically reduce bunyan's install size. dtrace-provider is used for dtrace features, mv is used for RotatingFileStream, and moment is used for local time. If you don't need these features, consider installing with the --no-optional flag.


            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone trentm/node-bunyan

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link