Merge pull request #216 from 2ion/gelf-no-full-message

GELF appender: don't send full_message field
This commit is contained in:
Gareth Jones 2014-07-12 15:02:17 +10:00
commit 914ed5356b
2 changed files with 2 additions and 5 deletions

View File

@ -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

View File

@ -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
}
}
}