Skip to content

Commit 440babc

Browse files
authored
Added a new Community Transport option to the list (#2140)
1 parent f707f33 commit 440babc

File tree

1 file changed

+35
-12
lines changed

1 file changed

+35
-12
lines changed

docs/transports.md

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ There are several [core transports](#built-in-to-winston) included in `winston`
1010
that leverage the built-in networking and file I/O offered by Node.js core. In
1111
addition, there are transports which are [actively supported by winston
1212
contributors](#maintained-by-winston-contributors). And last (but not least)
13-
there are additional transports written by
13+
there are additional transports written by
1414
[members of the community](#community-transports).
1515

1616
> Additionally there are transports previously maintained by winston
17-
> contributors that are [looking for maintainers](#looking-for-maintainers).
17+
> contributors that are [looking for maintainers](#looking-for-maintainers).
1818
1919
* **[Built-in to winston](#built-in-to-winston)**
2020
* [Console](#console-transport)
@@ -59,6 +59,7 @@ there are additional transports written by
5959
* [SQLite3](#sqlite3-transport)
6060
* [SSE with KOA 2](#sse-transport-with-koa-2)
6161
* [Sumo Logic](#sumo-logic-transport)
62+
* [Worker Thread based async Console transport](#worker-thread-based-async-console-transport)
6263
* [Winlog2 Transport](#winlog2-transport)
6364

6465
* **[Looking for maintainers](#looking-for-maintainers)**
@@ -147,7 +148,7 @@ The Stream transport takes a few simple options:
147148

148149
## Maintained by winston contributors
149150

150-
Starting with `[email protected]` an effort was made to remove any transport which added additional dependencies to `winston`. At the time there were several transports already in `winston` which will have slowly waned in usage. The
151+
Starting with `[email protected]` an effort was made to remove any transport which added additional dependencies to `winston`. At the time there were several transports already in `winston` which will have slowly waned in usage. The
151152
following transports are **actively maintained by members of the winston Github
152153
organization.**
153154

@@ -578,9 +579,9 @@ logger.log('info', 'Log from LogDNA Winston', meta);
578579

579580
### Logzio Transport
580581

581-
You can download the logzio transport here : [https://github.com/logzio/winston-logzio](https://github.com/logzio/winston-logzio)
582+
You can download the logzio transport here : [https://github.com/logzio/winston-logzio](https://github.com/logzio/winston-logzio)
582583

583-
*Basic Usage*
584+
*Basic Usage*
584585
```js
585586
const winston = require('winston');
586587
const Logzio = require('winston-logzio');
@@ -739,7 +740,7 @@ logger.add(new SeqTransport({
739740

740741
* __serverUrl__ - the URL for your Seq server's ingestion
741742
* __apiKey__ - (optional) The Seq API Key to use
742-
* __onError__ - Callback to execute when an error occurs within the transport
743+
* __onError__ - Callback to execute when an error occurs within the transport
743744

744745
### SimpleDB Transport
745746

@@ -762,7 +763,7 @@ The SimpleDB transport takes the following options. All items marked with an ast
762763
*Metadata:* Logged as a native JSON object to the 'meta' attribute of the item.
763764

764765
### Slack Transport
765-
[winston-slack-webhook-transport][39] is a transport that sends all log messages to the Slack chat service.
766+
[winston-slack-webhook-transport][39] is a transport that sends all log messages to the Slack chat service.
766767

767768
```js
768769
const winston = require('winston');
@@ -780,7 +781,7 @@ const logger = winston.createLogger({
780781
logger.info('This should now appear on Slack');
781782
```
782783

783-
This transport takes the following options:
784+
This transport takes the following options:
784785

785786
* __webhookUrl__ - Slack incoming webhook URL. This can be from a basic integration or a bot. **REQUIRED**
786787
* __channel__ - Slack channel to post message to.
@@ -803,7 +804,7 @@ logger.add(new wbs({
803804

804805
// path to the sqlite3 database file on the disk
805806
db: '<name of sqlite3 database file>',
806-
807+
807808
// A list of params to log
808809
params: ['level', 'message']
809810
}));
@@ -823,7 +824,28 @@ Options:
823824
* __url__: The Sumo Logic HTTP collector URL
824825

825826
### SSE transport with KOA 2
826-
[winston-koa-sse](https://github.com/alexvictoor/winston-koa-sse) is a transport that leverages on Server Sent Event. With this transport you can use your browser console to view your server logs.
827+
[winston-koa-sse](https://github.com/alexvictoor/winston-koa-sse) is a transport that leverages on Server Sent Event. With this transport you can use your browser console to view your server logs.
828+
829+
### Worker Thread based async Console transport
830+
831+
[winston-console-transport-in-worker][46]
832+
833+
```typescript
834+
import * as winston from 'winston';
835+
import { ConsoleTransportInWorker } from '@rpi1337/winston-console-transport-in-worker';
836+
837+
...
838+
839+
export const logger: winston.Logger = winston.createLogger({
840+
format: combine(timestamp(), myFormat),
841+
level: Level.INFO,
842+
transports: [new ConsoleTransportInWorker()],
843+
});
844+
```
845+
846+
The `ConsoleTransportInWorker` is a subclass of `winston.transports.Console` therefore accepting the same options as the `Console` transport.
847+
848+
TypeScript supported.
827849

828850
### Winlog2 Transport
829851

@@ -843,7 +865,7 @@ The winlog2 transport uses the following options:
843865

844866
## Looking for maintainers
845867

846-
These transports are part of the `winston` Github organization but are
868+
These transports are part of the `winston` Github organization but are
847869
actively seeking new maintainers. Interested in getting involved? Open an
848870
issue on `winston` to get the conversation started!
849871

@@ -937,7 +959,7 @@ In addition to the options accepted by the [riak-js][12] [client][13], the Riak
937959
## Find more Transports
938960

939961
There are more than 1000 packages on `npm` when [you search for] `winston`.
940-
That's why we say it's a logger for just about everything
962+
That's why we say it's a logger for just about everything
941963

942964
[you search for]: https://www.npmjs.com/search?q=winston
943965
[0]: https://nodejs.org/api/stream.html#stream_class_stream_writable
@@ -986,3 +1008,4 @@ That's why we say it's a logger for just about everything
9861008
[43]: https://www.npmjs.com/package/winston-bigquery
9871009
[44]: https://github.com/Quintinity/humio-winston
9881010
[45]: https://github.com/datalust/winston-seq
1011+
[46]: https://github.com/arpad1337/winston-console-transport-in-worker

0 commit comments

Comments
 (0)