nomiddlename/log4js-node — pull request #140 by karlvlam (2013-07-05 03:56:37+00:00)
Title: Add custom field support to GELF appender

GELF supports additional fields (https://github.com/Graylog2/graylog2-docs/wiki/GELF), I added this support in 2 ways:

1. If use want to add custom fields for every message, add the key-value pairs to config.customFields
````js
log4js.configure({
appenders: [
{
type: "gelf",
host: "LOG-SERVER",
hostname: "nodejs-app",
facility: "nodejs-facility",
customFields:
{
_http: 404,
_application: "My Application",
}
},
{type: 'console'},
]
});
````

2. If user want to add/overwrite custom fields for some message, add it as the first object to the logger call:
````js
logger({ GELF: true, _http:409, _application:"His Application" }, "This is an known issue")
````