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

Version Path
hooch-0.4.2 jasmine/node_modules/karma/node_modules/log4js/examples/logstashUDP.js
hooch-0.4.1 jasmine/node_modules/karma/node_modules/log4js/examples/logstashUDP.js
hooch-0.4.0 jasmine/node_modules/karma/node_modules/log4js/examples/logstashUDP.js
hooch-0.3.0 jasmine/node_modules/karma/node_modules/log4js/examples/logstashUDP.js
hooch-0.2.1 jasmine/node_modules/karma/node_modules/log4js/examples/logstashUDP.js
hooch-0.2.0 jasmine/node_modules/karma/node_modules/log4js/examples/logstashUDP.js
hooch-0.1.0 jasmine/node_modules/karma/node_modules/log4js/examples/logstashUDP.js
hooch-0.0.8 jasmine/node_modules/karma/node_modules/log4js/examples/logstashUDP.js
hooch-0.0.7 jasmine/node_modules/karma/node_modules/log4js/examples/logstashUDP.js
hooch-0.0.6 jasmine/node_modules/karma/node_modules/log4js/examples/logstashUDP.js
entangled-0.0.16 spec/dummy/public/node_modules/karma/node_modules/log4js/examples/logstashUDP.js
entangled-0.0.15 spec/dummy/public/node_modules/karma/node_modules/log4js/examples/logstashUDP.js
entangled-0.0.14 spec/dummy/public/node_modules/karma/node_modules/log4js/examples/logstashUDP.js
entangled-0.0.13 spec/dummy/public/node_modules/karma/node_modules/log4js/examples/logstashUDP.js
entangled-0.0.12 spec/dummy/public/node_modules/karma/node_modules/log4js/examples/logstashUDP.js
entangled-0.0.11 spec/dummy/public/node_modules/karma/node_modules/log4js/examples/logstashUDP.js
entangled-0.0.10 spec/dummy/public/node_modules/karma/node_modules/log4js/examples/logstashUDP.js