log2sb

0.2.3 • Public • Published

log2sb

Push String or Object to Azure service bus queue. Mainly used as an alternative of pushing critical log entries to Azure Service Bus Queue.


Usage

var log2sb = require(log2sb);

//// define the config
var config = {
    connString: "your-connection-string",
    busName: "your-queue-name",
    entityName: "your-entity-or-service" // should be given, otherwise random name will be generated on start
    // queueOpt --> optional, please follow Azure ServiceBus queue documentation on queue create
};

/// create log service
var logService = new log2sb(config);

// String data
var myData = "This is sample";
// Object data
var myData = {
    firstData: "This is sample",
    nextData: "Another sample"
};
// Metadata
var myMeta = {
    flowID: "ABC123",
    from: "source",
    to: "target"
};

/// push log service
logService.push(myMeta,myData)
.then(function(status){
    console.log(status);
})
.catch(function(e){
    console.log(e);
});

Returned Promise

Type Value
Resolve OK
Resolve FAIL_SEND
Reject FAIL_SBUS

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.3
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.3
    1
  • 0.2.2
    1
  • 0.2.1
    1
  • 0.2.0
    1

Package Sidebar

Install

npm i log2sb

Weekly Downloads

4

Version

0.2.3

License

MIT

Last publish

Collaborators

  • rytxyz