Should I log every API request or is that excessive?

0
2
Asked By CloudyNightSky12 On

I just started working at a company where every single API request is logged, including details like the HTTP method, endpoint path, status code, and timestamps. The downside is that these logs now account for about 95% of our total storage usage in RDS. From my research, it seems that best practices usually recommend logging errors and events rather than every single request. So, should I be logging every request in our microservice architecture, or is that too much?

6 Answers

Answered By DataWiz42 On

Logging every request is great for observability, but storing all those logs in RDS seems like overkill. I prefer using cloud services like CloudWatch for aggregation; it helps keep things manageable. I usually log essential data like request IDs and transit details, only including stack traces when errors pop up. This keeps the logging process lean and efficient!

Answered By CuriousCoder77 On

Whether to log everything might seem like an overkill, but it can really pay off in the long run. If you notice any odd patterns or issues, logging everything can give you insight you’d otherwise miss. If storage is tight, consider a plan to archive or rotate old logs out regularly.

Answered By DebuggingJunkie On

From an enterprise viewpoint, it's vital to log every API request. You never know how clients might misuse your API, and having those logs can save a ton of headaches during debugging. Just set a time-to-live (TTL) for your logs to manage costs effectively. It’s key to balance thorough logging with budget management.

HealthTechGuru -

Absolutely! Keeping a record can save you when clients claim something's broken. I had to prove that an LMS was blocking requests just by showing logs from a specific date. Saved us from a lot of unnecessary confusion!

Answered By AskMeAnything99 On

Storing all those logs in RDS must be pricey! It's advisable to move older logs to more affordable storage after a while if you're going this route. Older logs don’t need to stay in RDS for long if they aren’t actively accessed.

WinterExplorer -

Yeah, we're a small startup, so it's not too expensive right now. We're thinking of either moving logs to S3 or deleting them after a certain time to save costs.

Answered By AnalyticalMind23 On

Logging every request can be helpful, but the better approach is to archive older logs somewhere cheaper like Glacier. Just be mindful about access costs — if you need to check logs often, that becomes cumbersome and could eat into your budget.

Answered By RequestMaster900 On

It really depends on your request volume. If you have a large number of requests, logging everything could be excessive. Think about how quickly you're archiving older logs, as that also impacts storage costs and management.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.