What structured logging package do you recommend?

Sorry, I’ve sort of asked this question before:

I’m the devops guy, who just want to see nice JSON logs in CloudWatch which I can query easily like I want to see:

  • Show 4xx and 5xx responses
  • Where in the code the error message came from

If it could also log request duration and IP, that would be super useful too.

I received a vote for Pino. Meteor logging to Cloudwatch is poor · Issue #176 · unee-t/frontend · GitHub
Though I am curious as to what you use.

Many thanks!

We’re using Winston as a logging backend, with a local package serving as indirection and adding metadata about server/client, the connectionID and userID

Winston’s a bit heavy, and so we had to be careful not to let it get bundled to the client

Have a look at https://github.com/VeliovGroup/Meteor-logger/

Not sure what “isomorphic” means. It means it needs another logging driver? Ideally it would log as JSON strings so it can be queried by CloudWatch and it doesn’t appear to do that.

Not sure what “isomorphic” means. It means it needs another logging driver? Ideally it would log as JSON strings so it can be queried by CloudWatch and it doesn’t appear to do that.

In the context of Meteor, isomorphic code means code that can run on both the client and the server.

Does CloudWatch read from stdout and stderr? or is it API based?

I think most people just stream text to it from stdout. Though if they are JSON lines, they can be queried.

It doesn’t appear to have any special handling of stderr to me.

Considering pino outputs sinlge-line json by default, it looks like a really good option for you

1 Like

Meteor has core logging package which seems to work just fine for me. Log.info({message: "x", extra: 1}} for example.

1 Like