Skip to content

Wylio/meteor-winston-papertrail

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

meteor-winston-papertrail

A wrapper around winston-papertrail for using Papertrail transport with winston for use with Meteor :)

##Install $ meteor add wylio: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 logging 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.

About

A Winston Papertrail transport for Meteorite on top of Meteor.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%