I was having a discussion with my team and wanted to have everyone thoughts on how they configured logging in their frontend apps.
I happen to just reset console.log to an empty function on production builds but leave the warn and error in place.
But, is there any use of having logs enabled on production at all?
Top comments (5)
For frontend, specially when talking to an API, I feel there are several other things to keep in mind. For e.g. API failure (due to network issues and maybe session expiring) is not necessarily an issue with the app and does not need to be logged.
I'm not from them, but have you seen one of this month's sponsors, Timber? They specialize in logging and may be worth a look.
A quick glance at their page feels like they focus on the backend logging which is the whole point of the discussion.
Have you thought about pushing error logs to a server on production?
Yep, that's definitely the next step. But the first part is silencing the logs I already have. And then, filtering logs that are worth pushing to server.