Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/artcom/logger
- Owner: artcom
- License: mit
- Created: 2020-03-18T14:58:38.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-25T15:57:57.000Z (8 months ago)
- Last Synced: 2024-09-30T22:17:58.852Z (4 months ago)
- Language: TypeScript
- Size: 487 KB
- Stars: 0
- Watchers: 14
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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