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

https://github.com/superpaintman/winston-seq

A Seq transport for Winston
https://github.com/superpaintman/winston-seq

logger seq winston winston-transport

Last synced: about 2 months ago
JSON representation

A Seq transport for Winston

Awesome Lists containing this project

README

        

# 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]

--------------------------------------------------------------------------------

## Installation

```sh
$ npm install --save winston-seq
# Or with yarn
$ yarn add winston-seq
```

--------------------------------------------------------------------------------

## Usage

```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 expose
* `winston.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';
}
}
})
]
});

// ...
```

--------------------------------------------------------------------------------

## Build

```sh
$ npm install
$ # or
$ yarn
$
$ npm run build
```

--------------------------------------------------------------------------------

## Test

```sh
$ npm run test
```

--------------------------------------------------------------------------------

## Contributing

1. Fork it ()
2. Create your feature branch (`git checkout -b feature/`)
3. Commit your changes (`git commit -am '(): added some feature'`)
4. Push to the branch (`git push origin feature/`)
5. Create a new Pull Request

--------------------------------------------------------------------------------

## Contributors

- [SuperPaintman](https://github.com/SuperPaintman) SuperPaintman - creator, maintainer

--------------------------------------------------------------------------------

## Changelog
[Changelog][changelog-url]

--------------------------------------------------------------------------------

## License

[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/