winston-waterline

0.0.4 • Public • Published

winston-waterline

Winston transport for Waterline

Installation

First of all, install NPM

Then, use it to install Winston Waterline transport:

$ npm install winston-waterline

Usage

var winston = require('winston'),
    waterline = require('winston-waterline').Waterline,
    options = {
        ...
    };

// It exposes the transport to the winston transports list
winston.add(winston.trasports.Waterline, options);
// or
winston.add(waterline, options);

Options

  • collection {WaterlineCollection} (required): a Waterline Collection that represents a database table or a document. It must have the following fields: id, message and timestamp.

  • fields {Object}: a field mapping object, representing the database table fields or the document properties. By default, it has the following data:

    {
      id: 'id',
      message: 'message',
      timestamp: 'timestamp'
    }
    

    It can be overridden with a new map. For instance:

    {
      id: 'LOG_ID',
      message: 'LOG_MESSAGE',
      timestamp: 'LOG_TIMESTAMP',
      metadata: 'LOG_METADATA',
      userId: 'LOG_USERID'
    }
    
  • level {String}: the level of the transport. Default: info

  • silent {Boolean}: a flag to tell the transport to log even on the console. Default: true

  • safe {Boolean}: a flag to tell the transport to check the consistency of the saved log. Default: false

License

The MIT License (MIT)

Copyright (c) 2014 Vincenzo Ferrari wilk3ert@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package Sidebar

Install

npm i winston-waterline

Weekly Downloads

1

Version

0.0.4

License

MIT

Last publish

Collaborators

  • wilk