#support

Pino-HTTP for Express Nodejs App with Log Shipper

TLDR Nishant asks about log shippers for pino-http with Express Nodejs applications, and nitya-signoz shares a sample app and guide but is unfamiliar with pino-http.

Powered by Struct AI
Mar 17, 2023 (6 months ago)
Nishant
Photo of md5-c6e8dc7fcdf178830b4933494eff7768
Nishant
10:46 AM
Hey there anyone using pino-http with their express nodejs application if yes then what log shipper you are using to ship logs to signoz? Also would be great if you can share architecture around it
nitya-signoz
Photo of md5-a52b9d6c34f193d9a1ff940024f36f77
nitya-signoz
10:50 AM
Hey you can check out this example https://github.com/nityanandagohain/sample-NestJs-app/tree/feat/logger .


The architecture will be
nodeJsApp -> file -> signoz-collector -> signoz
10:52
nitya-signoz
10:52 AM
you can follow this guide on how to collect logs from file https://signoz.io/docs/userguide/collect_logs_from_file/ .

If your application is deployed on k8s/docker you don’t need to do the writing to file and collection step as it will be collected automatically from stdout
10:53
nitya-signoz
10:53 AM
Oh my bad you mentioned pino http
Nishant
Photo of md5-c6e8dc7fcdf178830b4933494eff7768
Nishant
10:53 AM
We are running our express apps using pm2 so console logs are transmitted to files made by pm2 process
10:55
Nishant
10:55 AM
right now we have winston in place but comparing the benchmarks against other options pino stands out so going to deprecate winston
nitya-signoz
Photo of md5-a52b9d6c34f193d9a1ff940024f36f77
nitya-signoz
10:56 AM
Got it, haven’t worked with pino-http, the above example I shared just uses pino. But in case of winston we use winston http transport and added tcp receiver on the signoz side to receive logs directly.
Nishant
Photo of md5-c6e8dc7fcdf178830b4933494eff7768
Nishant
10:59 AM
Cool, but thanks for this I’ll try to find something