logich-loggly-browser

0.0.3 • Public • Published

logich-loggly-browser is loggly.com middleware plugin for logich logger to be used in browser. Can be used with Browserify or Webpack.

Install:

npm install logich
npm install logich-loggly-browser

Start logging:

var logich = require("logich");
var loggly = require("logich-loggly-browser");
var logger = logich()
 
    // Transform all log messages into an object.
    .use(logich.object)
    
    // Add timestamp to log message.
    .use(logich.time)
    
    // Custom log entry middleware.
    .use(function(message, next) {
        message.source = "streamich.com";
        next(message);
    })
    
    // Print log message in console.
    .use(logich.console)
    
    // Send logs to loggly.com.
    .use(loggly("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"));
    
// Send log message to console and loggly.com:
logger.log({
    type: "error"
    message: "Hello world!"
});

Package Sidebar

Install

npm i logich-loggly-browser

Weekly Downloads

0

Version

0.0.3

License

none

Last publish

Collaborators

  • streamich