logfx-azure
v1.0.0
Published
Azure Monitor Log Analytics integration for logfx
Maintainers
Readme
logfx-azure
Azure Monitor Log Analytics transport for logfx.
Install
npm install logfx logfx-azureOptions
| Option | Type | Required | Description |
|--------|------|----------|-------------|
| workspaceId | string | yes | Log Analytics workspace ID |
| sharedKey | string | yes | Primary key from workspace |
| logType | string | no | Log type (default: LogFx) |
| batchSize | number | no | Batch size (default: 100) |
| flushInterval | number | no | Flush interval ms (default: 5000) |
Usage
import { createLogger } from 'logfx'
import { azureTransport } from 'logfx-azure'
const log = createLogger({
transports: [
azureTransport({
workspaceId: 'your-workspace-id',
sharedKey: 'your-primary-key'
})
]
})
log.info('Request received', { userId: 42 })Uses the HTTP Data Collector API. Get workspace ID and key from Log Analytics workspace > Agents.
