Add utility method to register a log handler