# wow-logger

> Node.JS simplistic logger that auto rotates logs

Latest version **1.0.13** (published 2019-03-20) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install wow-logger
pnpm add wow-logger
yarn add wow-logger
bun add wow-logger
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.13 |
| Published | 2019-03-20 |
| First published | 2018-12-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 0.3.0 |
| Dependencies | 1 |
| Unpacked size | 7.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Yusuf Khamis |
| Maintainers | lulliezy |
| Keywords | log, logging, wow, logger, logs, stream |

## Links

- npm: https://www.npmjs.com/package/wow-logger
- Repository: https://github.com/yusuf-khamis/wow-logger
- Homepage: https://github.com/yusuf-khamis/wow-logger#readme
- Issues: https://github.com/yusuf-khamis/wow-logger/issues
- npm.io page: https://npm.io/package/wow-logger

## Dependencies (1)

- [moment](https://npm.io/package/moment.md) ^2.23.0

## 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

- 1.0.13 (latest) — 2019-03-20
- 1.0.12 — 2019-03-12
- 1.0.11 — 2019-02-06
- 1.0.10 — 2019-01-22
- 1.0.9 — 2019-01-17
- 1.0.8 — 2019-01-17
- 1.0.7 — 2019-01-17
- 1.0.6 — 2018-12-25
- 1.0.5 — 2018-12-25
- 1.0.4 — 2018-12-25
- 1.0.3 — 2018-12-25
- 1.0.2 — 2018-12-25
- 1.0.1 — 2018-12-25
- 1.0.0 — 2018-12-20
- 0.1.0-beta.1 — 2018-12-20
- … 1 more at https://npm.io/package/wow-logger/versions

## README

# wow-logger

Node.JS simplistic logger that auto rotates logs

Wow logger was designed with the intention of making it extremely easy to log content from a NodeJS app with the feature of auto rotating files.

## Why wow logger

1. Its extremely light
2. Minimal configurations
3. Gets work done
4. Easy to get started

## Installation

``` sh
$ npm install wow-logger
```

## Options

* **output:** Specifies where to put the logs. Accepts `console` and `file` to either output to console or file respectively. Default is `file`.
* **levels:** Specifies the levels array in which to classify the logs in, these are not restricted to any values but only alpha characters allowed. Default is `[]`.
* **timestamp:** Whether or not to include timestamp in the logs. Default is `true`;
* **autorotate:** Specifies the frequency in which to rotate logs. Accepts `hourly`, `daily`, `none`. If `none` is specified, no logs will still be saved in the display name date format but will not be folderised. Default is `hourly`.
* **dirDateFormat** This sets the  date format for which to be used to name the folders when rotating logs. Accepts same formatting options as moment but only for date, month and year (DMY) and separators (-_., \/). Default is `DD-MMMM-YYYY`.
* **dateFormat** This sets the date format for naming the log files. Accepts same formatting options as moment. All log files have extension `.log`. When level specified e.g. _error_, log file will be _12-December-2018_error.log_ or _12-December-2018.log_ if level not specified. Default is `DD-MMMM-YYYYTHH`.
* **dir** This sets the location in which to store the logs (files or folders). Default is `.`.

## Usage

``` js

const logger = require('wow-logger');
const path = require('path');

const log = logger({
    output: 'file',
    levels: [
        'error',
        'warning',
        'info'
    ],
    timestamp: true,
    autorotate: 'hourly',
    dirDateFormat: 'DD-MMMM-YYYY',
    dateFormat: 'DD-MMMM-YYYYTHH',
    dir: path.resolve(__dirname, 'logs')
});

log('Hello wow logger with level', 'info'); //NB: If this level is not specified in levels option then it will be discarded

log('Hello wow logger without level');

```

## LICENCE

**MIT**

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