项目作者: kurtkincaid

项目描述 :
Bunyan stream for ArangoDB
高级语言: JavaScript
项目地址: git://github.com/kurtkincaid/bunyan-arangodb.git
创建时间: 2016-04-01T17:49:32Z
项目社区:https://github.com/kurtkincaid/bunyan-arangodb

开源协议:Apache License 2.0

下载


ArangoDB stream for Bunyan

Known Vulnerabilities

A simple and configurable ArangoDB for Bunyan. The module itself is relatively simple, so it should work with most versions of ArangoDB and the module dependencies.

Please note: This module will not create the database and/or collection for you. These must already exist in your ArangoDB instance when your code is run.

Installation

  1. npm install bunyan-arangodb

Basic Usage

  1. var bunyan = require( 'bunyan' );
  2. var bunyanArangoDB = require( 'bunyan-arangodb' );
  3. var _systemLogger = {
  4. 'src': false,
  5. 'name': 'systemLogger',
  6. 'serializers': bunyan.stdSerializers,
  7. 'streams': [ {
  8. 'level': 'info',
  9. 'stream': new bunyanArangoDB( {
  10. 'collection': 'systemLog',
  11. 'agentOptions': {}, // Standard agentOptions that are permitted with http.Agent and https.Agent (Optional)
  12. 'username': 'someGuy',
  13. 'password': 'myPassword',
  14. 'server': 'http://127.0.0.1:8529' // default
  15. 'db': '_system' // default
  16. } )
  17. } ]
  18. }
  19. var logger = bunyan.createLogger( _systemLogger );
  20. logger.info( {
  21. 'type' : 'notice',
  22. 'user': 'kurt'
  23. }, 'Kurt just added an entry in the systemLog collection.' );

API

Usage is straight forward and relatively simple. Starting with v1.0.0, you can pass agentOptions, which will allow for things such as trusting certificates issued from internal CAs.