pino icon indicating copy to clipboard operation
pino copied to clipboard

Custom transport absolute path

Open PedroJBrito opened this issue 3 years ago • 6 comments
trafficstars

Hi,

I've created a custom transport to send logs to an external log platform, however it is required that the target path for this custom transport is absolute. The problem is, if I set an absolute path, this path will need to be updated everywhere, depending on the machine where the project is being runned for tests or deployed for production. Is any way to solve this problem?

Thank you for your help.

PedroJBrito avatar Jun 14 '22 13:06 PedroJBrito

Could you make the destination configurable?

mcollina avatar Jun 14 '22 14:06 mcollina

Hi @mcollina ,

Well, if no other solution is available yes, but if there's a workaround that prevents have to change this path it would be better. Do you have any other alternative?

PedroJBrito avatar Jun 14 '22 14:06 PedroJBrito

This seems like application design to me. Resolve the path using path.resolve(path.join()).

jsumners avatar Jun 14 '22 14:06 jsumners

Hi @jsumners,

I tried that but after build the solution the file that contains my custom transport is inside of a chunk and no longer has the same name, so I couldn't solve the problem with this solution. Can you help me to get over this problem?

PedroJBrito avatar Jun 14 '22 14:06 PedroJBrito

Take a look at https://getpino.io/#/docs/bundling

mcollina avatar Jun 14 '22 14:06 mcollina

I'm sorry. I don't "build" server side JavaScript.

jsumners avatar Jun 14 '22 14:06 jsumners

It turns out relative path works just fine as well.

VladimirMikulic avatar Dec 02 '22 23:12 VladimirMikulic

I'm closing this as we don't seem to have anything to take action on.

jsumners avatar Dec 03 '22 14:12 jsumners

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Jan 03 '23 00:01 github-actions[bot]