A Seq transport for Winston
npm install winston-seq[![Linux Build][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]
[![Commitizen friendly][commitizen-image]][commitizen-url]
[![NPM version][npm-v-image]][npm-url]
[![NPM Downloads][npm-dm-image]][npm-url]
--------------------------------------------------------------------------------
``sh`
$ npm install --save winston-seqOr with yarn
$ yarn add winston-seq
--------------------------------------------------------------------------------
`ts
'use strict';
import { Logger } from 'winston';
import { Seq } from 'winston-seq';
const logger = new Logger({
transports: [
new Seq({
serverUrl: 'http://127.0.0.1:5341'
/ apiKey: '7fs2V60izlkgau2ansjH' /
})
]
});
`
or
`ts
'use strict';
var winston = require('winston');
/**
* Requiring winston-seq will exposewinston.transports.Seq
*
*/
require('winston-seq');
winston.add(winston.transports.Seq, {
serverUrl: 'http://127.0.0.1:5341'
/ apiKey: '7fs2V60izlkgau2ansjH' /
});
`
Use non-standard levels? Overwrite the mapper:
`ts
// ...
const logger = new Logger({
transports: [
new Seq({
levelMapper(level = '') {
switch (level.toLowerCase()) {
/* Winston Level -> Seq Level /
case 'error': return 'Error';
case 'warn': return 'Warning';
case 'info': return 'Information';
case 'debug': return 'Debug';
case 'verbose': return 'Verbose';
case 'silly': return 'Verbose';
case 'fatal': return 'Fatal';
default: return 'Information';
}
}
})
]
});
// ...
`
--------------------------------------------------------------------------------
`sh`
$ npm install
$ # or
$ yarn
$
$ npm run build
--------------------------------------------------------------------------------
`sh`
$ npm run test
--------------------------------------------------------------------------------
1. Fork it (
2. Create your feature branch (git checkout -b feature/)git commit -am '
3. Commit your changes ()git push origin feature/
4. Push to the branch (
5. Create a new Pull Request
--------------------------------------------------------------------------------
- SuperPaintman SuperPaintman - creator, maintainer
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
[MIT][license-url]
[license-url]: https://raw.githubusercontent.com/SuperPaintman/winston-seq/master/LICENSE
[changelog-url]: https://raw.githubusercontent.com/SuperPaintman/winston-seq/master/CHANGELOG.md
[npm-url]: https://www.npmjs.com/package/winston-seq
[npm-v-image]: https://img.shields.io/npm/v/winston-seq.svg
[npm-dm-image]: https://img.shields.io/npm/dm/winston-seq.svg
[travis-image]: https://img.shields.io/travis/SuperPaintman/winston-seq/master.svg?label=linux
[travis-url]: https://travis-ci.org/SuperPaintman/winston-seq
[coveralls-image]: https://img.shields.io/coveralls/SuperPaintman/winston-seq/master.svg
[coveralls-url]: https://coveralls.io/r/SuperPaintman/winston-seq?branch=master
[commitizen-image]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg
[commitizen-url]: https://commitizen.github.io/cz-cli/