Skip to content

PEM--/orionjs-logging

Repository files navigation

OrionJS - Logging

Provide an isomorphic logging capabilities for OrionJS.

Installation

meteor add orionjs:logging

Introduction

This package exposes Bunyan within OrionJS.

It declares a reusable logger in OrionJS as orion.log and a default formatter as orion.log.logFormatter. However in order to separate your application's logs from the one of OrionJS, we recommend you to instantiate your own logger like so:

// Client and server side
myAppLog = new bunyan.createLogger({
  name: 'myApp',
  stream: orion.logFormatter,
  level: 'info'
});
...
// And using it this way within your app
myAppLog.info('Info level logs');
myAppLog.warn('Warning level logs');
myAppLog.error('Error level logs');
...

Commands

Remove all logs from Orion

orion.log.level('none');

This is also applicable to your own logs.

Set a specific level of logs for Orion

// For debug level and aboves
orion.log.level('debug');
...
// For info level and above
orion.log.level('info');
...
// For fatal only level
orion.log.level('fatal');

This is also applicable to your own logs.

Links

About

Isomorphic logger for OrionJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published