npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

winston-azure-table-storage

v1.0.9

Published

A Windows Azure table storage transport for winston, updated with Azure SDK and winston library

Downloads

218

Readme

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 = require('winston');
  require('winston-azure-table-storage');
  winston.configure({
      transports: [
          new (winston.transports.AzureTable) ({
            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
          })
      ]
  });
  
  winston.warn('Hello toto!');

And here is the use of host/sas pair, created with Access Policies and SAS (See Storage Explorer fro details)

  var winston = require('winston');
  require('winston-azure-table-storage');

  
  winston.configure({
      transports: [
          new (winston.transports.AzureTable) ({
            host: "somestorage.table.core.windows.net", 
            sas: "The long Azure SAS", // something like '?sv=2015-12-11&si=Folder1-A123&tn=folder1&sig=BLA-BLA'
            table: "Folder1", //SAS usssualy also contains it
            partition: require('os').hostname(),
            level: 'warn',
            metaAsColumns: true
          })
      ]
  });
  
  winston.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
  • 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 entire meta value as a single JSON string in a 'meta' column.
  • rowKeyBuilder: A function to build the primary key, default is:
    function()
    {
        var rtext = '';
        var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
        for (var i = 0; i < 5; i++)
            rtext += possible.charAt(Math.floor(Math.random() * possible.length));
        return (new Date()).getTime() + '_' + (new Date()).getMilliseconds() + '_' + rtext;
    }