Skip to content

dewhurstwill/lm-logs-sdk-nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[unofficial] lm-logs-sdk-nodejs (beta)

NodeJS SDK for sending logs to LogicMonitor

Lines of Code Bugs Maintainability Rating Reliability Rating Security Rating Technical Debt Vulnerabilities

Install 📦

npm install lm-logs-sdk-node

Ingest:

Required Environment Variables:

  • COMPANY_NAME
  • ACCESS_ID
  • ACCESS_KEY
const { ingest } = require("lm-logs-sdk-node");

logs = [{
    "message": "Hello! from Logic Monitor",
    "_lm.resourceId": {
        "<lm_property>": "<lm_property_value>"
    }
}]

ingest(logs);

Logger:

Required Environment Variables:

  • COMPANY_NAME
  • ACCESS_ID
  • ACCESS_KEY
  • TARGET_PROPERTY (e.g. system.deviceId)
  • TARGET_VALUE (e.g. "123")

Example:

const { logger } = require("lm-logs-sdk-node");

logger("Hello! from Logic Monitor");

 // Log message would be a stringified version
logger(["Hello", "From", "Logic", "Monitor"]);
logger({ "Hello From": "Logic Monitor" });