willmorgan / winston-azure-application-insights

Azure Application Insights transport for Winston
MIT License
6 stars 7 forks source link

Winston logger option colorize breaks application insights integration #11

Open mrobst opened 2 years ago

mrobst commented 2 years ago

Hi - logging this here for info, perhaps it could be made into a note for the readme - let me know if you would like a PR for that?

Using this library (winston-azure-application-insights) works well but if the winston logger option colorize() is set then the log level passed is mangled like this "\u001b[31merror\u001b[39m". In that case the lookup in this library to convert logger levels to application insights levels always returns a level 1 (info) and so no exceptions are logged only a trace.

I've added this information to the main winston repo at this link - posting here for a cross reference also.

https://github.com/winstonjs/winston/issues/1941#issuecomment-1262093383

willmorgan commented 2 years ago

Yep, a PR that uses the "pure" log level would be very welcome!