[I’m unfamiliar with the landscape of third-party offerings here, so I’m going to limit myself to commenting on Apple stuff.]
Is lots of logging generally a good thing as long as sensitive info is
Yes, and no (-:
As with most things it’s a balancing act. My experience is that well-positioned logging is vital for investigating issues that only appear in the field (and helping developers debug such issues is an significant part of my job). However, there are drawbacks to too much logging:
Privacy — The unified logging system gives you the tools to handle this, you just have to use them correctly.
Size of the compiled binary — This one is pretty obvious. All code to log and the log messages themselves will increase the size of your binary.
Overwhelming the logging system — The unified logging system is pretty good about protecting itself from apps that log too much but it’s still possible to see negative effects. The most common of these is that a particularly ‘loggy’ app might push other, more useful, log events out of the system log.
The most important thing to get right is the log level. By default on iOS log entries at
.info and below will be suppressed at the point of log generation, so the only real negative with those is the binary size. If you log at
.default or higher, you need to be careful about not logging too much. My general advice is that you look at each of these higher-level log entries to make sure they contain info that might potentially useful while debugging.
Finally, make sure set the subsystem and category. The unified logging system processes a lot of log entries and the subsystem and category make it much easier for you to focus on specific problems.
Share and Enjoy
Quinn “The Eskimo!” @ DTS @ Apple