winston-appinsights-transport
Advanced tools
Comparing version 0.1.7 to 0.2.0
# ApplicationInsights Winstron Transport | ||
## 0.2.0 | ||
- expose maxBatchIntervalMs and useRetryDiskCache options | ||
## 0.1.7 | ||
@@ -4,0 +7,0 @@ - fix for request logging |
@@ -9,3 +9,8 @@ import * as TransportStream from 'winston-transport'; | ||
customFields?: AppInsightsCustomFields; | ||
clientOptions?: ClientOptions; | ||
} | ||
export interface ClientOptions { | ||
maxBatchIntervalMs?: number; | ||
useDiskRetryCaching?: boolean; | ||
} | ||
export interface AppInsightsRequest { | ||
@@ -30,5 +35,5 @@ name: string; | ||
private customFields; | ||
constructor({instrumentationKey, customFields, ...options}: AppInsightsOptions & TransportStream.TransportOptions); | ||
constructor({instrumentationKey, customFields, clientOptions, ...options}: AppInsightsOptions & TransportStream.TransportOptions); | ||
private handleUnhandledErrors(); | ||
log({message, level, ...properties}: TransportStream.TransportLogInfo, callback: Function): any; | ||
} |
@@ -40,3 +40,3 @@ "use strict"; | ||
constructor(_a) { | ||
var { instrumentationKey, customFields } = _a, options = __rest(_a, ["instrumentationKey", "customFields"]); | ||
var { instrumentationKey, customFields, clientOptions } = _a, options = __rest(_a, ["instrumentationKey", "customFields", "clientOptions"]); | ||
super(options); | ||
@@ -50,4 +50,8 @@ // We disabled auto collecting exceptions and requests because we need to inject the request id manually | ||
.setAutoDependencyCorrelation(false) // this is needed because otherwise winston + AI + pm2 crashes for unknown reasons... | ||
.setUseDiskRetryCaching(clientOptions ? clientOptions.useDiskRetryCaching : true) | ||
.start(); | ||
this.client = ai.defaultClient; | ||
if (clientOptions && clientOptions.maxBatchIntervalMs) { | ||
this.client.config.maxBatchIntervalMs = clientOptions.maxBatchIntervalMs; | ||
} | ||
this.customFields = customFields; | ||
@@ -54,0 +58,0 @@ this.handleUnhandledErrors(); |
{ | ||
"name": "winston-appinsights-transport", | ||
"version": "0.1.7", | ||
"version": "0.2.0", | ||
"description": "A winston transport for Application Insights", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11559
141