A node.js http to gelf logger
POST /gelf/log/{myapp}/{mycategory}/?token=xxx
add Content-Type: /application/json to the headers
md5(app + category + secretKey);
secretKey
is located in config/ENV.json
according to the {app}
The json contained in the request body will be merge in the message.
POST on /gelf/log/myapp/mycategory/ with this body :
{
"charlie": "jesuischarlie" ,
"test": "raoul"
}
will generate this gelf message :
{
"from" => "HttpToGelf - dev",
"level" => 6,
"version" => "1.0",
"host" => "MacBook-Pro-de-Olivier-2.local",
"@version" => "1",
"@timestamp" => "2015-01-08T15:09:16.257Z",
"source_host" => "127.0.0.1",
"message" => "{\"object\":\"message from application myapp, from category mycategory\",\"payload\":\"{\\\"charlie\\\":\\\"jesuischarlie\\\",\\\"test\\\":\\\"raoul\\\"}\",\"app\":\"myapp\",\"category\":\"mycategory\",\"test\":\"raoul\",\"charlie\":\"jesuischarlie\"}",
"object" => "message from application myapp, from category mycategory",
"payload" => "{\"charlie\":\"jesuischarlie\",\"test\":\"raoul\"}",
"app" => "myapp",
"category" => "mycategory",
"test" => "raoul",
"charlie" => "jesuischarlie"
}