-
Notifications
You must be signed in to change notification settings - Fork 145
Open
Description
Hello there!
Im running:
winston 3.14.2
applicationinsights 3.4.0
node 22.9.0
When running this:
import * as appInsights from 'applicationinsights'
try {
appInsights
.setup(process.env.APPLICATIONINSIGHTS_CONNECTION_STRING)
.setAutoCollectRequests(true)
.setAutoCollectPerformance(true, true)
.setAutoCollectExceptions(true)
.setAutoCollectDependencies(true)
.setAutoCollectConsole(true, true)
.setAutoCollectPreAggregatedMetrics(true)
.setSendLiveMetrics(false)
.setInternalLogging(false, true)
.enableWebInstrumentation(false)
.start()
} catch (error) {
console.error('Failed to initialize Application Insights:', error)
}
export const appInsightsClient = appInsights.defaultClientimport { appInsightsClient } from './utils/appInsights'
import { logger } from './utils/logger'
import { createLogger, transports } from 'winston'
const logger2 = createLogger({
transports: [new transports.Console()],
})
async function test() {
logger2.info('Info Test')
logger2.warn('Warn Test')
logger2.error('Error Test')
logger.info('Info Test my logger')
logger.warn('Warn Test my logger')
logger.error('Error Test my logger')
appInsightsClient.trackTrace({
message: 'Info Test SDK',
severity: 'Information',
})
console.log('Info Test console')
await appInsightsClient.flush()
}
test()I get this result in application insights:
Any ideas on what might be the issue here?
Thank you for taking the time! :))
espenja