'no-request_id' is lame as it won't be required
This commit is contained in:
parent
b3bd83c639
commit
216c1ba374
3 changed files with 6 additions and 9 deletions
1
TODO.md
1
TODO.md
|
@ -4,6 +4,7 @@
|
||||||
<https://github.com/Graylog2/graylog2-docs/wiki/GELF>
|
<https://github.com/Graylog2/graylog2-docs/wiki/GELF>
|
||||||
<http://journal.paul.querna.org/articles/2011/12/26/log-for-machines-in-json/>
|
<http://journal.paul.querna.org/articles/2011/12/26/log-for-machines-in-json/>
|
||||||
require: facility and hostname
|
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: more layouts (http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html)
|
||||||
- bunyan cli: filter args a la json
|
- bunyan cli: filter args a la json
|
||||||
- bunyan cli: -c COND args a la json
|
- bunyan cli: -c COND args a la json
|
||||||
|
|
13
bin/bunyan
13
bin/bunyan
|
@ -274,17 +274,14 @@ function handleLogLine(line, opts) {
|
||||||
}
|
}
|
||||||
var levelStr = (upperNameFromLevel[rec.level]
|
var levelStr = (upperNameFromLevel[rec.level]
|
||||||
|| "<unknown-level " + rec.level + ">");
|
|| "<unknown-level " + rec.level + ">");
|
||||||
var extras = [
|
var extras = [];
|
||||||
rec.request_id || "<no-request_id>"
|
if (rec.request_id) extras.push(rec.request_id);
|
||||||
];
|
if (rec.latency) extras.push(rec.latency + "ms");
|
||||||
if (rec.latency) {
|
extras = (extras.length ? ' (' + extras.join(', ') + ')' : '');
|
||||||
extras.push(rec.latency + "ms");
|
|
||||||
}
|
|
||||||
extras = extras.join(', ')
|
|
||||||
if (rec.msg.indexOf('\n') !== -1) {
|
if (rec.msg.indexOf('\n') !== -1) {
|
||||||
XXX
|
XXX
|
||||||
} else {
|
} else {
|
||||||
emit(format("[%s] %s: %s on %s: %s (%s)\n",
|
emit(format("[%s] %s: %s on %s: %s%s\n",
|
||||||
rec.time,
|
rec.time,
|
||||||
upperNameFromLevel[rec.level] || "<unknown-level " + rec.level + ">",
|
upperNameFromLevel[rec.level] || "<unknown-level " + rec.level + ">",
|
||||||
svc,
|
svc,
|
||||||
|
|
|
@ -9,7 +9,6 @@ log = new Logger({
|
||||||
{
|
{
|
||||||
level: "error",
|
level: "error",
|
||||||
path: "tmp/error.log"
|
path: "tmp/error.log"
|
||||||
// when to close file stream?
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue