winston-azure-table-storage
Table storage transport for winston Microsoft azure SDK. Fork of original winston-azure-sw project.
In short, with this library you can use account/key as well as host/sas. Also, it fixes bug with generation of entity key (if your app logs too fast, it's possible to generate same keys for different entities.) in original lib.
Installation
$ npm install winston$ npm install winston-azure-table-storage
Usage
Here is the use of account/key pair.
var winston = ;;winston;winston;
And here is the use of host/sas pair, created with Access Policies and SAS (See Storage Explorer fro details)
var winston = ;;winston;winston;
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
- host: The name of the Windows Azure storage host
- sas: The SAS used to authenticate and associated with given Access Policy
- 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 entiremeta
value as a single JSON string in a 'meta' column. - rowKeyBuilder: A function to build the primary key, default is:
{var rtext = '';var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';for var i = 0; i < 5; i++rtext += possible;return + '_' + + '_' + rtext;}