Giter VIP home page Giter VIP logo

log4js-azure-append-blob-appender's Introduction

log4js-azure-append-blob-appender

Built with Grunt Build Status Coverage Status NPM version Write log to Microsoft Azure Storage (append blob)

You should know when use this appender

  • if Azure Storage blob container do not exist, create it
  • if Azure Storage blob do not exist, create it
  • Check blob properties when writing text to the blob for the first time
  • This appender will append EOL symbol for every write operation, so you can view log file line by line
  • By default, this appender use basic log4js layout

Getting Started

installation

npm install log4js --save
npm install log4js-azure-append-blob-appender --save

usage:

This appender is compitable with log4js configuration file. for example, in your log4js configuration file (log4js.cfg.json)

{
    "appenders": [
        {
            "type": "console"
        },
        {
            "type": "log4js-azure-append-blob-appender",
            "category": "YOUR_CATEGORY",
            "azureStorageConnectionString": "DefaultEndpointsProtocol=https;AccountName=YOUR_ACCOUNT;AccountKey=YOUR_KEY",
            "container": "log4test",
            "appendBlob": "my.log",
            "layout": {
              "type":"basic"
            }
        }
    ],
    "replaceConsole": true
}
    var log4js = require('log4js');
    var cfg = require("./log4js.cfg.json");
    log4js.configure(cfg);
    
    var log = log4js.getLogger("YOUR_CATEGORY");
    
    log.debug("my msg", "data1");
    

About Configuration

Required configuration item

  • type
  • azureStorageConnectionString
  • container
  • appendBlob

Best Practice about this appender

Write json (instead of plain text) as every log line, so you can do more things (eg. use HDInsight to analyse log)

Update log

  • 1.0.1 (June 07 2016)
    • improve test
    • add gemfury version tag in readme
  • 1.0.0 (June 06 2016)
    • azure append validation
    • add test, improve readme
  • 0.0.1 (June 02 2016)
    • basic appender implement

log4js-azure-append-blob-appender's People

Contributors

danny8002 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.