Improved logging of API applications in MKG client

In the latest version of the MKG client, the logging of API applications has been improved. This ensures that users can rely on the logging being cleared correctly, even in exceptional situations.