Sha256: 5c4d762b3c9d9a2742d7ea5431b5d894b196eb4acac656698d14b1a249b22772
Contents?: true
Size: 801 Bytes
Versions: 17
Compression:
Stored size: 801 Bytes
Contents
var log4js = require('../lib/log4js'); /* Sample logstash config: udp { codec => json port => 10001 queue_size => 2 workers => 2 type => myAppType } */ log4js.configure({ "appenders": [ { type: "console", category: "myLogger" }, { "host": "127.0.0.1", "port": 10001, "type": "logstashUDP", "logType": "myAppType", // Optional, defaults to 'category' "fields": { // Optional, will be added to the 'fields' object in logstash "field1": "value1", "field2": "value2" }, "layout": { "type": "pattern", "pattern": "%m" }, "category": "myLogger" } ] }); var logger = log4js.getLogger("myLogger"); logger.info("Test log message %s", "arg1", "arg2");
Version data entries
17 entries across 17 versions & 2 rubygems