1

this is a very simple question to which I am not able to find a simple answer: how can I implement log4js to run in a react app?

I have tried to install the npm package https://www.npmjs.com/package/log4js

But this one seems to be made to run in a node application, and not a react application. the documentation is very scarce about how to use log4js in a react app. I can't find anything to help me.

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
julBayonna
  • 409
  • 7
  • 19

1 Answers1

2

log4j is a backend service,it's used to log events that happen on the backend, you can use it with a backend framework that would be the api and database of your application. react is a frontend framework, you can use a client side logger library such as https://github.com/pimterry/loglevel to log your errors in development. if you want to keep getting logs in production (after you deploy your website) use this plugin to send logs to your server https://github.com/kutuluk/loglevel-plugin-remote

Omar Soufiane
  • 183
  • 2
  • 3