Add logic to write log to form.