Skip to content

sjberry/bristol-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bristol-config

Adds node-config compatibility for Bristol logging. Not all features from Bristol are reproduced in the configuration. Currently excluded are:

  • Transforms link
  • Global values link
  • Excluding/including message filters link

If you need any of these features implemented, please open an issue, submit a pull request, or get in contact with me.

Installation

npm install bristol-config
npm install bristol

Note that bristol 0.3.x is a peer dependency of bristol-config and must be installed in your project for everything to work. If you're using an older version of npm, then bristol may be installed automatically. Otherwise you'll receive an npm notification indicating that you have a missing peer dependency.

Example

Sample node-config configuration:

{
  "logging": {
    "severity": "debug",
    "targets": [
      {
        "type": "console"
      },
      {
        "severity": "error",
        "type": {
          "name": "file",
          "options": {
            "file": "/var/log/bitscoop/metric-server.log"
          }
        }
      },
      {
         "severity": "info",
         "type": {
           "module": "my-target-module-constructor",
           "options": {
             "option": "value"
           }
         }
      },
      {
        "type": {
          "module": "my-target-module-function",
          "constructor": false,
          "options": {
            "option": "value"
          }
        }
      }
    ]
}

Usage:

var bristolConf = require('bristol-config');
var config = require('config'); // Requires node-config to function as indicated.

logger = bristolConf(config.logging);

About

Integration for Bristol logging and node-config configuration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published