Added missing includes
Use LoggedErrorsSummary functions rather than the global variables

All global variables associated with Logging of the MessageLogger error
messages have been made private since they were changed to be thread-safe.
This code has been changed to use the public functions instead.