Adding a variety of logging messages to help me figure out what happened just before an application crash.