You can expand yours Formsto register errors as soon as the completion of the check is completed:
class LoggingMixin(object):
def full_clean(self):
super(LoggingMixin, self).full_clean()
for field, errors in self.errors.iteritems():
logger.info('Form error in %s: %s', ', '.join(errors))
Then define your forms using mixing logging:
class MyForm(LoggingMixin, forms.Form):
...
When Django 1.7 is missing, you will also be able to catch exception messages as they occur. This will give you unhandled exceptions as they have been raised ( Formdoes some checking):
class LoggingMixin(object):
def add_error(self, field, error):
if field:
logger.info('Form error on field %s: %s', field, error)
else:
logger.info('Form error: %s', error)
super(LoggingMixin, self).add_error(field, error)
: add_error Django <= 1.6.