# winston-this

> Winston Logger Module

Latest version **1.0.3** (published 2017-10-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install winston-this
pnpm add winston-this
yarn add winston-this
bun add winston-this
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2017-10-24 |
| First published | 2017-10-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ariel Rey |
| Maintainers | arielfr |
| Keywords | winston, logger, helper |

## Links

- npm: https://www.npmjs.com/package/winston-this
- Repository: https://github.com/arielfr/winston-this
- Homepage: https://github.com/arielfr/winston-this#readme
- Issues: https://github.com/arielfr/winston-this/issues
- npm.io page: https://npm.io/package/winston-this

## Dependencies (1)

- [winston](https://npm.io/package/winston.md) ^2.4.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.3 (latest) — 2017-10-24
- 1.0.2 — 2017-10-24
- 1.0.1 — 2017-10-24
- 1.0.0 — 2017-10-24

## README

# winston-this

This is a simple winstone logger module to add on your NodeJS project

## Install

```bash
npm install winston-this
```

## Usage

> Create a log instance

```javascript
const logger = require('winston-this')();
```

```javascript
logger.info('Hello');

// 2017-10-24T12:00:00.000Z - info: Hello - [level:INFO]
```

> Create a log instance with a custom tag to identify it

```javascript
const logger = require('winston-this')('api');
```

```javascript
logger.info('Hello');

// 2017-10-24T12:00:00.000Z - info: Hello - [name:api] [level:INFO]
```

### Tag Usage

You can pass tags to pass more information

```javascript
logger.info('Hello', { user: 'arielfr' });

// 2017-10-24T12:00:00.000Z - debug: Hello - [name:api] [user:arielfr] [level:DEBUG]
```

## Log Levels

To specify a log level you can use the environmental variable `LOG_LEVEL`.

````javascript
PROCESS.env.LOG_LEVEL = 'DEBUG';
````

> The default log level is **INFO**

## License

Copyright 2017

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