pino
pino copied to clipboard
Custom transport absolute path
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.
Could you make the destination configurable?
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?
This seems like application design to me. Resolve the path using path.resolve(path.join()).
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?
Take a look at https://getpino.io/#/docs/bundling
I'm sorry. I don't "build" server side JavaScript.
It turns out relative path works just fine as well.
I'm closing this as we don't seem to have anything to take action on.
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.