mirror of
https://github.com/log4js-node/log4js-node.git
synced 2025-12-08 19:26:01 +00:00
Merge pull request #329 from mercury2269/patch-1
Add missing category field
This commit is contained in:
commit
aeb03afee3
@ -21,7 +21,8 @@ function logstashUDP (config, layout) {
|
||||
'@timestamp': (new Date(loggingEvent.startTime)).toISOString(),
|
||||
type: type,
|
||||
message: logMessage,
|
||||
fields: fields
|
||||
fields: fields,
|
||||
category: loggingEvent.logger.category
|
||||
};
|
||||
sendLog(udp, config.host, config.port, logObject);
|
||||
};
|
||||
|
||||
@ -42,7 +42,7 @@ function setupLogging(category, options) {
|
||||
vows.describe('logstashUDP appender').addBatch({
|
||||
'when logging with logstash via UDP': {
|
||||
topic: function() {
|
||||
var setup = setupLogging('logstashUDP', {
|
||||
var setup = setupLogging('myCategory', {
|
||||
"host": "127.0.0.1",
|
||||
"port": 10001,
|
||||
"type": "logstashUDP",
|
||||
@ -73,6 +73,7 @@ vows.describe('logstashUDP appender').addBatch({
|
||||
};
|
||||
assert.equal(JSON.stringify(json.fields), JSON.stringify(fields));
|
||||
assert.equal(json.message, 'Log event #1');
|
||||
assert.equal(json.category, 'myCategory');
|
||||
// Assert timestamp, up to hours resolution.
|
||||
var date = new Date(json['@timestamp']);
|
||||
assert.equal(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user