Skip to content
This repository has been archived by the owner on Feb 25, 2019. It is now read-only.

Logging

Christian Smith edited this page Jul 6, 2014 · 3 revisions

Anvil Connect supports logging to file, console, syslog and logstash via bucker. To configure logging, add an logger options object to your config.ENV.json file.

{
  "issuer": "https://anvilconnect-12629.onmodulus.net",
  "client_registration": "dynamic",
  "logger": { 
    "file": {
      "filename": "/path/to/file",
      "format": ":level :time :data",
      "timestamp": "HH:mm:ss",
      "accessFormat": ":time :level :method :status :url"
    },
    "console": {
      "color": false
    },
    "syslog": {
      "host": "localhost",
      "port": 514,
      "facility": 18
    },
    "logstash": {
      "redis": true, // send as redis pubsub messages
      // udp: true, // or send directly over UDP, *NOTE* you can only use one or the other, never both
      "host": "127.0.0.1", // defaults to localhost
      "port": 12345, // defaults to 6379 for redis, 9999 for udp
      "key": "bucker_logs", // defaults to 'bucker', this is only used for the redis transport
      "channel": true, // use redis pubsub
      "list": false, // use a redis list *NOTE* if channel is false, list usage is forced
      "source_host": "bacon.com" // this sets the @source_host field in logstash
    }
  }
}