Skip to content

madsquare/log-notifier

This branch is up to date with egg-/log-notifier:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ada3b90 · May 27, 2015

History

13 Commits
May 27, 2015
May 27, 2015
May 7, 2015
May 12, 2015
May 12, 2015
May 27, 2015
May 7, 2015
May 27, 2015

Repository files navigation

log-notifier

version download

simple notifier for logs.

Usage

var Notifier = require('log-notifier');

var notifier = null;

if (mode === 'development') {
    notifier = new Notifier.Logger({
        prefix: 'hostname',
        format: 'lll'
    });
} else {
    if (target === 'hipchat') {
        // hipchat
        notifier = new Notifier.Hipchat({
            "room": "monitor",
            "auth_token": "__auth_token__",
            "room_token": "__room_token__",
            "mention": [
              "@rei"    // for push notification
            ],
            "allow": "error|info",
            "prefix": "api"
        });
    } else if (target === 'slack') {
        notifier = new Notifier.Slack({
            "webhookurl": "__webhookurl__",
            "channel": "#report",
            "mention": [
                "@rei"
            ],
            "allow": "error|info",
            "name": "api",
            "icon": "https://slack.com/img/icons/app-57.png"
        });
    }
}

// use
notifier.log('message');
notifier.info('message');
notifier.warn('message');
notifier.error('message');

Available

LICENSE

log-notifier is licensed under the MIT license.

About

simple notifier for logs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%