Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/artcom/logger

A Winston logger which logs to JSON with ordered keys and error stack support.
https://github.com/artcom/logger

Last synced: 3 months ago
JSON representation

A Winston logger which logs to JSON with ordered keys and error stack support.

Awesome Lists containing this project

README

        

# Logger

A [Winston](https://github.com/winstonjs/winston) logger which logs to JSON with ordered keys and error stack support.

# Usage

Install this library via npm:

```bash
npm install @artcom/logger
```

Use as follows:

```javascript
const { createLogger } = require("@artcom/logger");
const logger = createLogger();

logger.info("Hello world!");
```

Additional options are supported:

- `transports`: is the array of transports managed by [Winston](https://github.com/winstonjs/winston)
- `keyOrder` is the array specifying the order of message keys (e.g. ["timestamp", "level", "message"]), additional keys are placed after these keys by insertion order