diff --git a/lib/appenders/gelf.js b/lib/appenders/gelf.js index 8e075b5..e536462 100644 --- a/lib/appenders/gelf.js +++ b/lib/appenders/gelf.js @@ -48,7 +48,9 @@ function gelfAppender (layout, host, port, hostname, facility) { host = host || 'localhost'; port = port || 12201; hostname = hostname || require('os').hostname(); - facility = facility || 'nodejs-server'; + if(facility) { + customFields['_facility'] = facility; + } layout = layout || layouts.messagePassThroughLayout; var defaultCustomFields = customFields || {}; @@ -103,7 +105,6 @@ function gelfAppender (layout, host, port, hostname, facility) { msg.timestamp = msg.timestamp || new Date().getTime() / 1000; // log should use millisecond msg.host = hostname; msg.level = levelMapping[loggingEvent.level || levels.DEBUG]; - msg.facility = facility; return msg; }