Skip to content

How to add nodejs / winston log messages to Azure Application Insights

Notifications You must be signed in to change notification settings

CSA-OCP-GER/nodejs-winston-appinsights

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example of using nodejs / winston logger in combination with Azure Application Insights

Clone this project to your local machine. Install dependencies via npm install in the root directory.

INFO: The following packages have been added:

"dependencies": {
    "applicationinsights": "^1.0.2",
    "winston": "^2.4.1",
    "winston-azure-application-insights": "^1.3.0"
  }

Replace YOUR_INSTRUMENTATION_KEY_FROM_APPINSIGHTS in the file app.js with your AppInsights instrumentation key (line 5). (How to get it? https://github.com/Microsoft/ApplicationInsights-Home/wiki#getting-an-application-insights-instrumentation-key)

Run the application via npm start

Next, use Postman or a browser to create some requests (http://127.0.0.1:10010/hello?name=Scott) and after a few seconds, trace messages will be visible in your AppInsights instance in Azure.

Links:

https://www.npmjs.com/package/winston https://www.npmjs.com/package/winston-azure-application-insights https://www.npmjs.com/package/applicationinsights

Documentation for AppInsights can be found here:

https://docs.microsoft.com/en-us/azure/application-insights/app-insights-nodejs-quick-start

UPDATE :)

In the meantime, you can use winston in combination with AppInsights without using winston-azure-application-insights. It just works :)

About

How to add nodejs / winston log messages to Azure Application Insights

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published