Refactored logging codes.
Updated application management script.