Skip to content

Yet another Windows Azure table storage transport for the node.js Winston logging framework, updated with new Azure SDK.

License

Notifications You must be signed in to change notification settings

ergina/winston-azure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

winston-azure

NPM version

Yet another Windows Azure table storage transport for winston, utilizing the latest (octobre 2014) Microsoft azure SDK.

Inspired by winston skywriter transport, but compatible with latest Microsoft Azure SDK for NodeJS.

Installation

  $ npm install winston
  $ npm install winston-azure

Usage

  var winston = require('winston');
  require('winston-azure');
  
  var logger = new (winston.Logger)({
    transports: [
        new (winston.transports.Azure)({
            account: "Azure storage account sub domain ([A-Za-z0-9])",
            key: "The long Azure storage secret key",
            table: "The name of the table (why not just 'log'?)",
            partition: require('os').hostname(),
            level: 'warn',
            metaAsColumns: true
        })
    ]
  });
  
  logger.warn('Hello toto!');

The Azure transport accepts the following options:

  • level: Level of messages that this transport should log (defaults to info).
  • account: The name of the Windows Azure storage account to use
  • key: The access key used to authenticate into this storage account
  • table: The name of the table to log to (defaults to 'log'). Must already exist.
  • partition: The value to use for the PartitionKey in each row (defaults to 'log').
  • metaAsColumns: If true, the transport will store the metadata key/value pairs in individual columns (this can be helpful when querying table storage for log entries with specific metadata values). The default is to store the entire meta value as a single JSON string in a 'meta' column.
  • rowKeyBuilder: A function to build the primary key, default is:
    function()
    {
        return (new Date()).getTime() + '_' + (new Date()).getMilliseconds();
    }

About

Yet another Windows Azure table storage transport for the node.js Winston logging framework, updated with new Azure SDK.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published