microsoft / ApplicationInsights-node.js

Microsoft Application Insights SDK for Node.js
MIT License
325 stars 140 forks source link

Winston 2.4.4 not working on NodeJS 8 but Console does #485

Closed Jonlondon closed 5 years ago

Jonlondon commented 5 years ago

Using Winston 2.4.4 and AppInsights 1.1.0, winston logging doesn't send any data to AppInsights while console.log does. I used the same sample in your documentation

let winston = require('winston');
winston.log('info', "test %s", 'info');

I added console.log in nodules_modules locally and nothing shows in winston.sub.js subscriber function.

Thanks.

markwolff commented 5 years ago

Hi @Jonlondon, just wondering if you tried to repro this in a standalone test app, or are you seeing this in a built out one?

Jonlondon commented 5 years ago

Hi @markwolff, it occurs in a built out one. Let me try in a standalone app.

Jonlondon commented 5 years ago

Hi @markwolff. OK I found why. It works on standalone app, I just forgot to declare appInsights module before my logger module.