Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qiwi/logwrap
Bloody enterprise logger tools
https://github.com/qiwi/logwrap
js-platform
Last synced: 4 days ago
JSON representation
Bloody enterprise logger tools
- Host: GitHub
- URL: https://github.com/qiwi/logwrap
- Owner: qiwi
- License: mit
- Created: 2018-11-10T12:40:23.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T20:44:31.000Z (17 days ago)
- Last Synced: 2024-10-29T22:51:23.049Z (17 days ago)
- Topics: js-platform
- Language: JavaScript
- Size: 760 KB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# logwrap
Bloody enterprise logger tools.[![buildStatus](https://api.travis-ci.com/qiwi/logwrap.svg?branch=master)](https://travis-ci.com/qiwi/logwrap)
[![Coverage Status](https://coveralls.io/repos/github/qiwi/logwrap/badge.svg?branch=master)](https://coveralls.io/github/qiwi/logwrap?branch=master)
[![dependencies Status](https://david-dm.org/qiwi/logwrap/status.svg)](https://david-dm.org/qiwi/logwrap)
[![devDependencies Status](https://david-dm.org/qiwi/logwrap/dev-status.svg)](https://david-dm.org/qiwi/logwrap?type=dev)
[![Maintainability](https://api.codeclimate.com/v1/badges/93156a859b14c75e3e34/maintainability)](https://codeclimate.com/github/qiwi/logwrap/maintainability)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com)### Motivation
Which logger to choose? _Any_. Because it doesn't matter at all. Just look at the problem from a different perspective. Logging is stateful data processing — pipeline of formatters, translators that ends in persistent storage. Really significant things:
* Context detailing
* Tracing (MDC)
* Sensitive data masking### Install
```bash
yarn add @qiwi/logwrap
npm i @qiwi/logwrap
```### Usage
```javascript
// logger.jsimport {Logwrap, masker as maskerFactory, mdc as mdcFactory} from '@qiwi/logwrap'
import winston from 'winston'
import DailyRotateFile from 'winston-daily-rotate-file'const { createLogger, transports: {Console}, config: {colorize}} = winston
winston.transports.DailyRotateFile = DailyRotateFileconst mdc = mdcFactory()
const masker = maskerFactory()
const logger = createLogger()
logger.configure({...})const logwrap = new Logwrap({
pipeline: [mdc, masker, logger],
level: 'DEBUG'
})export default logwrap
```