Google Groups

Re: [nodejs] Logging

Matt Sergeant Dec 14, 2011 2:51 AM
Posted in group: nodejs
The key thing that we learned in Haraka is that logging is only useful if you can find the issue that you're looking for (especially relevant on high throughput servers).

So in Haraka every log line tries to get a UUID associated with the current transaction attached to it.

That way if someone gets an 500 error page you can include the current UUID, and if they ask about it you can find the log entries for that UUID.

This has been a HUGE win for large installations.

On Wed, Dec 14, 2011 at 2:02 AM, Mikeal Rogers <> wrote:
I've spent some time rethinking logging.

Logging is strange problem. It needs to be instrumented, to some degree, in all the modules we use, not just in our application code.

For debugging and increased visibility in to production you just want to be notified of the internal workings. 

The traditional log4j approach is kind of ridiculous to instrument as a module developer, you don't really have a need for log levels for instance.

Logging is also one of the very few cases that we need a truly process global module that is not in core.

So, i started to think about what the most minimal API for such a logger might bem.

I created an implementation and a draft spec. The idea here is that we define a minimal logger that different people can implement so long as they obey this minimal API contract. Then in my own modules, like request, I'm going to check for `process.logging` and if it's there I'll get myself a log function and use it accordingly.

I'm open to suggestions about the API but keep in mind that the last of features is it's greatest feature. Anything that can be built on top of this API without any breaking changes should not be in the spec portion.

I'm sure there are typos and misspellings, it's quite late and i'm beat. I'll be using this in request starting tomorrow.


Job Board:
Posting guidelines:
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at