Hi everyone.
I’m trying to send the Strapi logs to Logflare using the official Pino transport pino-logflare. I’ve tried with the CLI using their example but seems like it will not work with the Strapi default logging to console.
Is there any way to achieve this?
Thanks!
This will be a difficult one, you will most likely have to fork and maintain at least a local copy (in the project, you can use something like the local npm module) as pino is only declared in one part of the entire project: strapi/logger.js at master · strapi/strapi · GitHub
You can create something like a ./packages
folder at the root of your project, copy the strapi-utils package there, and modify it. Then you can declare that module using the file:packages/strapi-utils
in the package.json. Just note you will have to maintain this fork for every single Strapi update including minor versions and diff your version against ours.
Indeed seems like a pretty difficult one. Do you have any other advice on how to transport the log from Strapi to an external service like Logflare?
Not like Logflare (which in my research has a very small number of connectors O_o) but I personally use Graylog and a pm2 gelf module
This unfortunately doesn’t fit with my current solution since I’m not using pm2, I’m simply running Strapi in a Docker Compose environment. I’m thinking if I should deep search on transport Docker logs instead of Strapi ones 
That might be the better solution (or you can run pm2 inside the container, but that’s not really recommended since you won’t see the log output with the docker logs
command)