log4js-logstash
This is a very simple log4js appender that can talk to logstash instances. This version is still very specific to Gembly Games B.V. but feel free to fork and adjust =)
Installation
You can install install log4js-logstash by adding this .git url to your package.json
Usage: logstash configuration
In the "input" part of the logstash server conf :
input {
tcp {
codec => "json"
data_timeout => 10
port => 5959
type => "tcp-input"
}
}
Usage: log4js configuration
Plain javascript
var log4js = ; log4js; var log = log4js; log;
Or in YAML
appenders: [ { type: 'console', category: [ 'WEBSERVER','TEST' ] }, { type: 'log4js-logstash', host: 'localhost', port: 5959, batch: { size: 200, timeout: 10 }, fields: { instance: 'MyAwsInstance', source: 'myApp', environment: 'development', }, category: [ 'WEBSERVER','TEST' ] } ]replaceConsole: true