Giter VIP home page Giter VIP logo

meteor-winston-papertrail's Introduction

meteor-winston-papertrail

A wrapper around winston-papertrail for using Papertrail transport with winston for use with Meteorite on top of Meteor :)

##Install mrt add winston-papertrail

##Usage

Winston is exposed as:

Winston

And papertrail transport is exposed as:

Winston_Papertrail

so it can be used as follows:

Create a file called logging.js in the lib folder in the root or your app. The Lib folder is called first so that loging is exposed early on.

Don't forget to change PORT to the port number provided to you by PapertailApp.com.

if(Meteor.isServer) {
  
  //creating a global server logger
  log = Winston;
  
  log.add( Winston_Papertrail, {
  	levels: {
  		debug: 0,
  		info: 1,
  		warn: 2,
  		error: 3,
  		auth: 4
  	},
  	colors: {
  		debug: 'blue',
  		info: 'green',
  		warn: 'red',
  		error: 'red',
  		auth: 'red'
  	},
  
  	host: "logs.papertrailapp.com",
  	port: PORT, 
  	handleExceptions: true,
  	json: true,
  	colorize: true,
  	logFormat: function(level, message) {
  		return level + ': ' + message;
  	}
  });
}

You can paste this at the bottom of the logging.js code to test that it is working correctly.

log.info(" =====> Meteor App restarted "+ new Date( Date.now()) +" <=====");

See winston-papertrail documentation for more details.

meteor-winston-papertrail's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

meteor-winston-papertrail's Issues

handleExceptions - does it work?

I've not been able to get handleExceptions to do anything. Is it just me?

The discussion here meteor/meteor#1640 suggests that Meteor's inbuilt exception management may cause issues with capturing exception events in node.

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.