Team LiB
Previous Section Next Section

Changing the Log Level

In Chapter 5, we discussed how you can turn logging on or off by changing a setting in the XML config file. That's very easy for a developer to do. But do you trust your customers to manually edit an XML file? Why not provide customers a tool for turning logging on and off? That would make it easier for them to turn on the product's logging. Maybe your diagnostic utility should include a button to automatically turn logging on or off. After all, the diagnostic utility seems like a logical place for such log-related functionality.

I've had bad experiences putting an Enable logging button in the diagnostic utility, though. Turning on logging is only half the story—once logging is on, customers need to run the program again to generate logs. Turning on the logging doesn't go back in time and make the previous run produce logs. But for some reason, many customers fail to make that connection. They're told the diagnostic utility will gather logs, so they run it once and use it to turn on logging. Now they think logs have already been generated, and they sometimes even think the diagnostic utility has already sent those logs to tech support. They don't realize they need to run the program again to produce logs, and then run the utility a second time to send those logs to you.

I've never quite understood why so many customers get confused by that process, but for some reason, they do. So instead of including an Enable logging button in the diagnostic utility, I'd recommend creating a separate utility just for that. Users seem to understand this process better: Run one utility to turn on logging, run your program, then run a different utility to gather the logs.


Team LiB
Previous Section Next Section