winston-gcloud

1.0.1 • Public • Published

winston-gcloud

Google Cloud Logging transport for winston

GCL transport for winston with support for queue and batch write to reduce api usage.

Installation

$ npm install winston-gcloud --save

Usage

var winston = require('winston')
 
var GoogleCloudLogging = require('winston-gcloud')
 
var options = {
    level: 'verbose',
    gcl_project_id: '<project-id>',
    gcl_key_filename: '<key-file-name>',
    gcl_log_name: '<log-name>',
    batch_size: 5
}
winston.add(GoogleCloudLogging, options);
 
winston.error('test', {msg: Math.random()})
winston.error('test', {msg: Math.random()})
winston.error('test', {msg: Math.random()})
winston.error('test', {msg: Math.random()})
winston.error('test', {msg: Math.random()})
winston.error('test', {msg: Math.random()})
winston.error('test', {msg: Math.random()})
winston.error('test', {msg: Math.random()})
winston.error('test', {msg: Math.random()})
winston.error('test', {msg: Math.random()})

winston-gcloud use better-queue for queue management.

License

MIT © Tuan Anh Tran

Package Sidebar

Install

npm i winston-gcloud

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • tuananh