fix uninitialized field error

This commit is contained in:
Jens John 2014-07-11 19:19:19 +09:00
parent 2b0a58c2f2
commit 52b4aa1874

View File

@ -48,13 +48,14 @@ function gelfAppender (layout, host, port, hostname, facility) {
host = host || 'localhost';
port = port || 12201;
hostname = hostname || require('os').hostname();
if(facility) {
customFields['_facility'] = facility;
}
layout = layout || layouts.messagePassThroughLayout;
var defaultCustomFields = customFields || {};
if(facility) {
defaultCustomFields['_facility'] = facility;
}
var client = dgram.createSocket("udp4");
process.on('exit', function() {