# log-notifier

> simple notifier for logs.

Latest version **0.2.0** (published 2015-05-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install log-notifier
pnpm add log-notifier
yarn add log-notifier
bun add log-notifier
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2015-05-27 |
| First published | 2015-05-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | egg |
| Maintainers | egg- |
| Keywords | log, hipchat, notifier |

## Links

- npm: https://www.npmjs.com/package/log-notifier
- Repository: https://github.com/egg-/log-notifier
- Homepage: https://github.com/egg-/log-notifier#readme
- Issues: https://github.com/egg-/log-notifier/issues
- npm.io page: https://npm.io/package/log-notifier

## Dependencies (3)

- [moment](https://npm.io/package/moment.md) ^2.10.2
- [hipchatter](https://npm.io/package/hipchatter.md) ^0.2.0
- [slack-node](https://npm.io/package/slack-node.md) ^0.1.3

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 0.2.0 (latest) — 2015-05-27
- 0.1.0 — 2015-05-12

## README

# log-notifier

[![version](https://img.shields.io/npm/v/log-notifier.svg) ![download](https://img.shields.io/npm/dm/log-notifier.svg)](https://www.npmjs.com/package/log-notifier)

simple notifier for logs.

## Usage

```javascript
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
* Hipchat: https://www.hipchat.com/
* Slack Incoming Wehooks: https://my.slack.com/services/new/incoming-webhook/

## LICENSE

log-notifier is licensed under the MIT license.

---
_Source: https://npm.io/package/log-notifier · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
