3 ms·
Don't SPAM the logs. You don't need to log every method call, every variable, every "if" statement, ect. That's what the debugger is for. And, I shouldn't nee
by gwbas1c 5y ago
Don't SPAM the logs.
You don't need to log every method call, every variable, every "if" statement, ect. That's what the debugger is for.
And, I shouldn't need to say it: Don't log passwords or other sensitive information.
Also: Make sure your logger is configured correctly. Log4Net used to (and it still might) calculate an entire stack trace with each call to the logger. It can be the single highest consumption of CPU in an application; even if you aren't actually logging stack traces.
- TameAntelope 5y agoIf you're using a tool like Splunk, verbosity of logging is usually not much of a problem.
- sagichmal 5y agoOnly at trivial request volume. It’s easy to overwhelm any logging system without discipline.
- TameAntelope 5y agoNah, Splunk can handle anything you throw at it.
- sagichmal 5y agoI am currently at an organisation where Splunk is a bottleneck.
- TameAntelope 5y agoNo, you are currently at an organization that hasn't allocated enough resources to Splunk.
- sagichmal 5y agoHah! OK, sure.
- albertgoeswoof 5y agoBut if I don’t log everything, why did I build a massive ELK stack for my big data logs
- saimiam 5y ago> You don't need to log every method call, every variable, every "if" statement, ect. That's what the debugger is for. Lambdas don't have debuggers afaik. So, verbose logging is the simplest (only?) way out. Probably not at the "let's log every action" level but I find myself erring on the side of logging more rather than less.