You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After struggling for a few hours I finally got next-logger and pino to work within Docker but the docs here need to be improved. I hope by raising this issue it saves people time. Here are the necessary steps I took in order to get it to work correctly.
Make sure next-logger.config.js file is located in the root of the project (alongside package.json for example)
Add NEXT_RUNTIME=nodejs ENV variable in Docker - Since next-logger is required in instrumentation.ts|js file typically the library will only be loaded if the runtime is nodejs. This variable is set by Vercel automatically but if you are not deploying on Vercel you have to do it manually.
After struggling for a few hours I finally got
next-logger
andpino
to work within Docker but the docs here need to be improved. I hope by raising this issue it saves people time. Here are the necessary steps I took in order to get it to work correctly.next-logger.config.js
file is located in the root of the project (alongside package.json for example)NEXT_RUNTIME=nodejs
ENV variable in Docker - Sincenext-logger
is required ininstrumentation.ts|js
file typically the library will only be loaded if the runtime isnodejs
. This variable is set by Vercel automatically but if you are not deploying on Vercel you have to do it manually.// Dockerfile ENV NEXT_RUNTIME=nodejs
next-logger
andpino
toserverComponentsExternalPackages
property in Next configuration -next-logger.config.js
file from the root of the project and place it in the runtime image in the same folder asserver.js
. Thank you: Additional fields not showing in the log object #26 (comment) for thisThank you to all the developers making this project!
The text was updated successfully, but these errors were encountered: