DEV Community

Discussion on: How to log everything?

Collapse
 
brandinchiu profile image
Brandin Chiu

What you inevitably log is totally up to you: you're the programmer.

If you want to log everything, you can totally do that, but it would be a lot of work to maintain, and a lot of data to sift through if a bug comes up.

You want to be careful that you're not actually making your job harder by logging too much. Then you need to worry about looking for the needle in that haystack.

Another concern to keep in mind is the logging isn't free. Depending on where your logs are stored, there are going to be latency, storage, and financial costs to logging that must be considered.

Finally, there are legal ramifications to what you log. Depending on local and regional laws, logging personal or even some non-personal information may be prohibited.

For example, PCI compliance dictates what kind of things you can and can't log in regards to credit card numbers.