A program for parsing yolo logs - fork of isaacs / couchdb-log-parse
var LogParse = require('yolo-log-parser')
var parser = new LogParse()
fs.createReadStream('yolo.log').pipe(parser)
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:
dateThe date that the log was postedlevelUsually one of info, log, or errortypeEither 'http', 'controller', 'model' or 'misc'
Depending on the type they may have the following fields as well:
ipThe requesting IP. (If you're behind a proxy or load balancer, then it's not super interesting.)methodSomething like GET, POST, PUT, etc.urlThe url requestedstatusCodeThe response status code.userAgentresponseTime
controllermethod
modelactionid
messageWhatever it was that couldn't be parsed.