-
New to the framework and understand there are portions that run on the server vs on the client and didn't know if there was a recommended logging framework that works best? Starting to mess with Winston which seems to work on server-side code but once I through it into a component, it throws errors looking for an 'fs' dependency. Any suggestions would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 10 replies
-
I've used debug for both client & server console logging in the past with Next. Otherwise if you want to log to a file, you'll only be able to do this in any of the functions that run on the server (for example |
Beta Was this translation helpful? Give feedback.
-
I was able to resolve this by using Pino for client (I could have used this on the server) and also using Winston (but just for server). Winston would not work for me in client logging because it appears to full in the 'fs' library and this causes errors in the client portions of the code. I was able to get Bunyan working in the client but Pino was just cleaner. |
Beta Was this translation helpful? Give feedback.
-
We were looking for an isomorphic logging solution so that a developer doesn't have to care whether they are logging on the client side or server side. We used |
Beta Was this translation helpful? Give feedback.
-
Hi, I configured Pino logger to support both client and server on nextJS. While the application is running smoothly. I am trying to lo to Datadog from nextJS. But my logs are not flowing to DD . I cant see any logs received by my pod. I have logger.ts in utils and tracer.init({}) initialized in layout.tsx file. What different I should be doing to get it working? |
Beta Was this translation helpful? Give feedback.
I was able to resolve this by using Pino for client (I could have used this on the server) and also using Winston (but just for server). Winston would not work for me in client logging because it appears to full in the 'fs' library and this causes errors in the client portions of the code. I was able to get Bunyan working in the client but Pino was just cleaner.