Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large objects #42

Open
isaacs opened this issue Sep 17, 2012 · 2 comments
Open

Large objects #42

isaacs opened this issue Sep 17, 2012 · 2 comments

Comments

@isaacs
Copy link
Contributor

isaacs commented Sep 17, 2012

I often see stuff like this in my bunyan output:

[2012-09-16T03:11:26.564Z] ERROR: npm-www/69031 on 0803bb29-b3dc-4291-8633-a6bf53d4d3ff.local:  (worker=12)
    error: {
      "domain_emitter": {
        "output": [
          "HTTP/1.1 200 OK\r\nstrict-transport-security: 2592000000\r\netag: \"FCJtJOvYRL/8Q3H+2joOcLyPTvw=\"\r\nx-templar-stamp: pid=69031 worker=12 7759ed21d5d6da24f50ff0a3ce6e41d6f898d116 https://npmjs.org:10012\r

It'd be nice if a few common large objects were handled specially. In particular, HTTP request and response objects, and sockets, and buffers, all tend to be astronomical. Buffers should always be truncated so that they're also not so gigantic.

There's already a JSON stringifier function there, we could just use that.

@trentm
Copy link
Owner

trentm commented Sep 17, 2012

Special instanceof or whatever handling or top-level objects? I'm leery of adding that because of speed and special casing for top level objects. Serializers are intended for this, but I realize that requires forethought instead of Bunyan making it easy.

@trentm
Copy link
Owner

trentm commented Sep 18, 2012

Wait is that "error" a standard JS Error object (granted possibly extended with domains info)? If so, the intention is to use the 'err' serializer ... and Error instances are also special-cased if the first arg to log.info et al.

The intro provided by the current Bunyan readme sucks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants