'no-request_id' is lame as it won't be required

master
Trent Mick 2012-01-30 16:45:25 -08:00
parent b3bd83c639
commit 216c1ba374
3 changed files with 6 additions and 9 deletions

View File

@ -4,6 +4,7 @@
<https://github.com/Graylog2/graylog2-docs/wiki/GELF>
<http://journal.paul.querna.org/articles/2011/12/26/log-for-machines-in-json/>
require: facility and hostname
line/file: possible to get quickly with v8?
- bunyan cli: more layouts (http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html)
- bunyan cli: filter args a la json
- bunyan cli: -c COND args a la json

View File

@ -274,17 +274,14 @@ function handleLogLine(line, opts) {
}
var levelStr = (upperNameFromLevel[rec.level]
|| "<unknown-level " + rec.level + ">");
var extras = [
rec.request_id || "<no-request_id>"
];
if (rec.latency) {
extras.push(rec.latency + "ms");
}
extras = extras.join(', ')
var extras = [];
if (rec.request_id) extras.push(rec.request_id);
if (rec.latency) extras.push(rec.latency + "ms");
extras = (extras.length ? ' (' + extras.join(', ') + ')' : '');
if (rec.msg.indexOf('\n') !== -1) {
XXX
} else {
emit(format("[%s] %s: %s on %s: %s (%s)\n",
emit(format("[%s] %s: %s on %s: %s%s\n",
rec.time,
upperNameFromLevel[rec.level] || "<unknown-level " + rec.level + ">",
svc,

View File

@ -9,7 +9,6 @@ log = new Logger({
{
level: "error",
path: "tmp/error.log"
// when to close file stream?
}
]
});