Updated cpp app to properly log events on the system.