Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (34 sloc) 1.21 KB


A program for parsing CouchDB logs


var LogParse = require('couchdb-log-parse')
var parser = new LogParse()


parser.on('data', function (c) {
  // this is the raw data, don't know why you need this, but whatever

parser.on('message', function (message) {
  // this is probably what you want.
  // it's the parsed object with informative fields


The parsed messages all have these fields:

  • date The date that the log was posted
  • level Usually one of info, warn, or error
  • pid Not a real pid. Some kind of silly erlang goober.
  • type Either 'http', 'erl', or 'misc'

Depending on the type they may have the following fields as well:


  • ip The requesting IP. (If you're behind a proxy or load balancer, then it's not super interesting.)
  • method Something like GET, POST, PUT, etc.
  • url The url requested
  • statusCode The response status code.


  • message Whatever comes before the dump. Sometimes blank.
  • dump The dumped erlang object. (If someone wants to write a parser for the erlang objdump notation, that'd be rad.)


  • message Whatever it was that couldn't be parsed.