Skip to content

Commit

Permalink
Added some documentation magic
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarvesh Chitko committed Feb 22, 2019
1 parent 7b3089f commit 17846bc
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
# winston-logstash
<a name="module_LogstashTransport"></a>

This module adds a Logstash transport to Winston to simplify logging to ELK. This plugin supports multiple inputs for Logstash thus enabling the user to make the choice that best suits his/her needs.
## LogstashTransport

* [LogstashTransport](#module_LogstashTransport)
* [module.exports](#exp_module_LogstashTransport--module.exports)
* [new module.exports(options)](#new_module_LogstashTransport--module.exports_new)
* [~LogstashTransport](#module_LogstashTransport--module.exports..LogstashTransport) ⇐ <code>Transport</code>

<a name="exp_module_LogstashTransport--module.exports"></a>

### module.exports ⏏
**Kind**: Exported class
<a name="new_module_LogstashTransport--module.exports_new"></a>

#### new module.exports(options)

| Param | Type | Description |
| --- | --- | --- |
| options | <code>Object</code> | The Configuration object |
| options.name | <code>String</code> | The name of the transport |
| options.input | <code>String</code> | The input that you want to use |
| options.host | <code>String</code> | The Logstash server host |
| options.port | <code>String</code> | The port of the Logstash pipeline you've configured |

<a name="module_LogstashTransport--module.exports..LogstashTransport"></a>

#### module.exports~LogstashTransport ⇐ <code>Transport</code>
**Kind**: inner class of [<code>module.exports</code>](#exp_module_LogstashTransport--module.exports)
**Extends**: <code>Transport</code>
9 changes: 7 additions & 2 deletions index.js → src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ module.exports =
class LogstashTransport extends Transport {
/**
*
* @param {*} options
* @param {Object} options - The Configuration object
* @param {String} options.name - The name of the transport
* @param {String} options.input - The input that you want to use
* @param {String} options.host - The Logstash server host
* @param {String} options.port - The port of the Logstash pipeline you've configured
*/
constructor(options){
super(options);
this.name='LogstashTransport'
this.input=options.input

this.host = options.host
this.port = options.port
}
log(info,callback) {
setImmediate(()=>{
Expand Down

0 comments on commit 17846bc

Please sign in to comment.