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: 4 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 (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-25T15:57:57.000Z (about 1 year ago)
- Last Synced: 2025-02-08T19:17:18.084Z (5 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