ErrorLog
Error log entry DocType.
Stores information about system errors for debugging.
Errors are captured by the global exception handler.
Attributes:
title: Short description of the error
error_type: Exception class name (e.g., "ValueError")
error_message: Full error message
traceback: Stack trace for debugging
request_url: URL that triggered the error
user_id: User who triggered the error
request_id: Request ID for correlation
timestamp: When the error occurred
context: Additional context (headers, params, etc.)
Example:
log = ErrorLog(
title="Validation failed",
error_type="ValidationError",
error_message="Field 'email' is invalid",
)
Source: error_log.py
Fields
| Field | Type | Required | Description | Validators |
|---|---|---|---|---|
| title | str | ✓ | Short description of the error | maxLen: 255 |
| error_type | str | ✓ | Exception class name (e.g., ValueError) | - |
| error_message | str | ✓ | Full error message | - |
| traceback | str | None | Full stack trace for debugging | |
| request_url | str | None | URL that triggered the error | |
| user_id | str | None | User who triggered the error | |
| request_id | str | None | Request ID for log correlation | |
| timestamp | datetime | When the error occurred (UTC) | - | |
| context | dict[str, Any] | None | Additional context: headers, params, etc. |
Permissions
| Role | Create | Delete | Read | Write |
|---|---|---|---|---|
| System Manager | ✓ | ✓ |
Configuration
| Setting | Value |
|---|---|
| Submittable | False |
| Track Changes | True |
Controller
Controller hooks are implemented in *_controller.py files.
Available lifecycle hooks:
validate()- Called before save, raise exceptions for validation errorsbefore_insert()- Called before inserting a new documentafter_insert()- Called after successfully insertingbefore_save()- Called before saving (insert or update)after_save()- Called after savingbefore_delete()- Called before deletingafter_delete()- Called after deleting