mirror of
https://github.com/log4js-node/log4js-node.git
synced 2025-12-08 19:26:01 +00:00
Merge pull request #216 from 2ion/gelf-no-full-message
GELF appender: don't send full_message field
This commit is contained in:
commit
914ed5356b
@ -96,8 +96,7 @@ function gelfAppender (layout, host, port, hostname, facility) {
|
||||
function preparePacket(loggingEvent) {
|
||||
var msg = {};
|
||||
addCustomFields(loggingEvent, msg);
|
||||
msg.full_message = layout(loggingEvent);
|
||||
msg.short_message = msg.full_message;
|
||||
msg.short_message = layout(loggingEvent);
|
||||
|
||||
msg.version="1.0";
|
||||
msg.timestamp = msg.timestamp || new Date().getTime() / 1000; // log should use millisecond
|
||||
|
||||
@ -119,8 +119,7 @@ vows.describe('log4js gelfAppender').addBatch({
|
||||
assert.equal(message.host, require('os').hostname());
|
||||
assert.equal(message.level, 6); //INFO
|
||||
assert.equal(message.facility, 'nodejs-server');
|
||||
assert.equal(message.full_message, message.short_message);
|
||||
assert.equal(message.full_message, 'This is a test');
|
||||
assert.equal(message.short_message, 'This is a test');
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -251,7 +250,6 @@ vows.describe('log4js gelfAppender').addBatch({
|
||||
assert.equal(message._every2, 'Overwritten!'); // the overwritten value
|
||||
assert.equal(message._myField, 'This is my field!'); // the value for this message only
|
||||
assert.equal(message.short_message, 'Just testing.'); // skip the field object
|
||||
assert.equal(message.full_message, 'Just testing.'); // should be as same as short_message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user