Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
appinsights-logger
Advanced tools
wrapper for AI setup, compatible with Azure Functions
npm i appinsights-logger --save
Just set ENV variable APPINSIGHTS_INSTRUMENTATIONKEY
Set the AI_MESSAGE_NAMESPACE ENV variable to identify message source. Format is [myCompany].[AgileTeam].[Repo] (foocompany.Architecture.Appinsights)
const { trackEvent, trackException } = require('appinsights-logger')
trackEvent({ name: 'TEST', properties: { myProp: 'my value' } })
const ex = new Error('some error')
trackException({ exception: ex, properties: { myProp: 'my value' } })
import { markDependency, measureDependency } from 'appinsights-logger'
const marker = markDependency('HTTP', 'GET /products')
try {
const url = 'https://domain.com/api/products'
const locations = await requestPromise(url)
measureDependency(marker, url)
} catch(ex) {
measureDependency(marker, url, false)
// could also trackException(ex) here
}
dependency tracking is useful for measuring latency of remote calls (SQL, HTTP) and also failures
import { markDependency, measureDependency } from 'appinsights-logger'
const marker = markDependency('cosmos', 'query collection')
try {
const sql = 'select top 100 from c'
const locations = await cosmosDb.items.query(sql) // pseudo-code cosmos query
measureDependency(marker, sql)
} catch(ex) {
measureDependency(marker, sql, false)
// could also trackException(ex) here
}
customEvents are powerful because you can query the logs by the
customDimensions
object
import { trackDebugEvent } from from 'appinsights-logger'
// This 'debug' event will only log if the DEBUG_INSIGHTS="true" env var is set
trackDebugEvent({ name: 'new order', properties: { order }, measurements: { productCount: order.products.length } })
cp .env.example .env
fill in
.env
with App Insight key
npm run build
npm test
FAQs
thin, yet opinionated wrapper for applcation insights
The npm package appinsights-logger receives a total of 100 weekly downloads. As such, appinsights-logger popularity was classified as not popular.
We found that appinsights-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.