Giter VIP home page Giter VIP logo

good-bunyan's People

Contributors

aalimovs avatar droguljic avatar fbaiodias avatar galenandrew avatar jgantunes avatar jondlm avatar kyleamathews avatar mariocasciaro avatar stefanomagrassi avatar sublimino avatar tiagoalves avatar tobiasbueschel avatar travi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

good-bunyan's Issues

responsePayload: true: Converting circular structure to JSON error on large JSON response

I am using good, good-bunyan, and hapi-swagger.

Logging works fine, until I hit the swagger documentation. The documentation endpoint returns swagger.json

I get the following error while making the /documentation which fetches the swagger.json (this is quite large). I have set responsePayload: true, with this set to false, everything works fine.

Debug: internal, implementation, error
    TypeError: Converting circular structure to JSON
    at Object.stringify (native)
    at Object.defaultFormatters.response (/Users/zzakaria/code/orc/orcfacade/node_modules/good-bunyan/lib/index.js:21:38)
    at DestroyableTransform.goodBunyanTransform [as _transform] (/Users/zzakaria/code/orc/orcfacade/node_modules/good-bunyan/lib/index.js:123:58)
    at DestroyableTransform.Transform._read (/Users/zzakaria/code/orc/orcfacade/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:159:10)
    at DestroyableTransform.Transform._write (/Users/zzakaria/code/orc/orcfacade/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:147:83)
at doWrite (/Users/zzakaria/code/orc/orcfacade/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:313:64)
    at writeOrBuffer (/Users/zzakaria/code/orc/orcfacade/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:302:5)
    at DestroyableTransform.Writable.write (/Users/zzakaria/code/orc/orcfacade/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:241:11)
    at ondata (_stream_readable.js:529:20)
    at emitOne (events.js:90:13)
    at emit (events.js:182:7)
    at readableAddChunk (_stream_readable.js:147:16)
    at Readable.push (_stream_readable.js:111:10)
    at Transform.push (_stream_transform.js:128:32)
    at internals.Squeeze._transform (/Users/zzakaria/code/orc/orcfacade/node_modules/good-squeeze/lib/squeeze.js:31:14)
    at Transform._read (_stream_transform.js:167:10)
    at Transform._write (_stream_transform.js:155:12)
    at doWrite (_stream_writable.js:292:12)
    at writeOrBuffer (_stream_writable.js:278:5)
    at Writable.write (_stream_writable.js:207:11)
    at Readable.ondata (_stream_readable.js:529:20)
    at emitOne (events.js:90:13)
    at Readable.emit (events.js:182:7)
    at readableAddChunk (_stream_readable.js:147:16)
    at Readable.push (_stream_readable.js:111:10)
    at internals.Monitor._responseHandler (/Users/zzakaria/code/orc/orcfacade/node_modules/good/lib/monitor.js:244:22)
    at emitOne (events.js:90:13)
    at emit (events.js:182:7)

"good-bunyan" FileReporter - Server.log Tags Are Missing

Hi,

When using the server.log function with multiple tags it is not documented in the log entry in the file.
For example - For the following server.log command
server.log(['log','server','start','demo','info','tag1','tag2','tag3'], {message: Server started at ${ server.info.uri }, uri: server.info.uri});

The good-console will write to the console:
180909/213134.152, [log,log,server,start,demo,info,tag1,tag2,tag3] data: {"message":"Server started at http://computer:50268","uri":"http://computer:50268"}

And the good-bunyan will write to the file (Using the bunyan logger):
{"name":"demo-logger","hostname":"computer","pid":9396,"level":30,"message":"Server started at http://computer:50268","uri":"http://computer:50268","msg":"[log]","time":"2018-09-09T21:31:34.157Z","v":0}

My question is why the tags are not also written to the log in the file?

Attached the code I used in my question (example.zip).

Thanks,
Shay
example.zip

good 7.0.0

Hey,

Long time bunyan user since restify. Hopped on hapi bandwagon just recently and trying to implement good-bunyan.

However, am I right to assume it is not currently compatible with the good's recent 7.0.0 release?

Error: Cannot pipe, not readable

I get an error when I try to pipe good-bunyan into white-out. Here's my configuration:

export const good = {
    register: require('good'),
    options: {
        reporters: {
            bunyan: [{
                module: 'good-bunyan',
                args: [
                    { ops: '*', request: '*', log: '*', response: '*', error: '*'},
                    { logger: log }
                ]
            }, {
                module: 'white-out',
                args: [{
                  password: 'censor'
                }]
            }]
        }
    }
};

I'm using good-bunyan in conjunction with white-out a censoring plugin referenced in the Hapi documentation. Whenever good attempts to pipe the output of good-bunyan into white-out, it seems to fail. However, good-bunyan by itself works fine.

Here's the error message I get from the server:

There was a problem (Error: Cannot pipe, not readable) in bunyan and it has been destroyed.
Error: Cannot pipe, not readable
    at GoodBunyan.Writable.pipe (_stream_writable.js:186:22)
    at pipe (/project/node_modules/pump/index.js:54:15)
    at Array.reduce (native)
    at pump (/project/node_modules/pump/index.js:77:18)
    at Pumpify.setPipeline (/project/node_modules/pumpify/index.js:39:5)
    at new Pumpify (/project/node_modules/pumpify/index.js:15:30)
    at Function.Pumpify [as obj] (/project/node_modules/pumpify/index.js:13:44)
    at internals.forOwn (/project/node_modules/good/lib/monitor.js:147:53)
    at Object.internals.forOwn (/project/node_modules/good/lib/monitor.js:230:9)
    at Monitor.start (/project/node_modules/good/lib/monitor.js:105:19)

Node version: v7.10.0
bunyan: 1.8.10
good: 7.2.0
good-bunyan: 1.3.0
hapi: 16.4.3,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.