Mirror of Apache CouchDB

Clone this repo:
  1. 7b58ab2 Merge remote branch 'apache:add-couch_log_twig-backend' by ILYA Khlopotov · 8 years ago master
  2. 72dccc6 Implement couch_log behaviour by ILYA Khlopotov · 8 years ago
  3. ec94988 Merge remote-tracking branch 'cloudant/unicode' by Robert Newson · 9 years ago
  4. d9757ad Fix logging of invalid Unicode data by Paul J. Davis · 10 years ago
  5. 9393f4d Allow facility override in options by Robert Newson · 9 years ago

Twig is a SASL-compliant Erlang/OTP logger. It installs a gen_event handler in the error_logger event manager, where it consumes standard OTP reports and messages as well as events generated by twig:log/2,3,4. Log messages are written to a syslog server over UDP using the format specified in RFC 5424.

Twig's behavior is controlled using the application environment:

  • host (undefined): the hostname of the syslog server
  • port (514): the port of the syslog server
  • facility (local2): syslog facility to be used
  • level (info): logging threshold. Messages “above” this threshold (in syslog parlance) will be discarded. Acceptable values are debug, info, notice, warn, err, crit, alert, and emerg.
  • appid (“twig”): inserted as the APPID in the syslog message
  • max_term_size (8192): raw data size below which we format normally
  • max_message_size (16000): approx. max size of truncated string