Giter Site home page Giter Site logo

davidflorin / winston-loggly Goto Github PK

View Code? Open in Web Editor NEW

This project forked from winstonjs/winston-loggly

0.0 2.0 0.0 288 KB

A Loggly transport for winston

Home Page: http://github.com/indexzero/winston-loggly

License: MIT License

JavaScript 100.00%

winston-loggly's Introduction

winston-loggly

A Loggly transport for winston.

Usage

  var winston = require('winston');
  
  //
  // Requiring `winston-loggly` will expose 
  // `winston.transports.Loggly`
  //
  require('winston-loggly');
  
  winston.add(winston.transports.Loggly, options);

The Loggly transport is based on Nodejitsu's node-loggly implementation of the Loggly API. If you haven't heard of Loggly before, you should probably read their value proposition. The Loggly transport takes the following options. Either 'inputToken' or 'inputName' is required:

  • level: Level of messages that this transport should log.
  • subdomain: The subdomain of your Loggly account. [required]
  • auth: The authentication information for your Loggly account. [required with inputName]
  • inputName: The name of the input this instance should log to.
  • inputToken: The input token of the input this instance should log to.
  • json: If true, messages will be sent to Loggly as JSON.
  • tags: An array of tags to send to loggly.
  • stripColors: Strip color codes from the logs before sending

Metadata: Logged in suggested Loggly format

Motivation

tldr;?: To break the winston codebase into small modules that work together.

The winston codebase has been growing significantly with contributions and other logging transports. This is awesome. However, taking a ton of additional dependencies just to do something simple like logging to the Console and a File is overkill.

Installation

Installing npm (node package manager)

  $ curl http://npmjs.org/install.sh | sh

Installing winston-loggly

  $ npm install winston
  $ npm install winston-loggly

Run Tests

All of the winston tests are written in vows, and cover all of the use cases described above. You will need to add valid credentials for the various transports included to test/config.json before running tests:

  {
    "transports": {
      "loggly": {
        "subdomain": "your-subdomain",
        "inputToken": "really-long-token-you-got-from-loggly",
        "auth": {
          "username": "your-username",
          "password": "your-password"
        }
      }
    }
  }

Once you have valid configuration and credentials you can run tests with npm:

  npm test

License: MIT

winston-loggly's People

Contributors

indexzero avatar jcrugzz avatar chjj avatar framerate avatar joeybaker avatar nachoman avatar ronxjansen avatar

Watchers

James Cloos avatar Florin David avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.