File Logging
File Logging
Active
Retain detailed records in a size-limited rotating file.
Command
[tool.custy.logging.file]Category
Logging Configuration
Quick Command
[tool.custy.logging.file]Properties
Properties
| Property | Type | Description | Default | Required |
|---|---|---|---|---|
level | DEBUG | INFO | WARNING | ERROR | CRITICAL | Threshold for persistent records. | DEBUG | No |
log_dir | Directory path | Directory created when logging is initialized. | logs | No |
log_file | Filename | Active log filename inside log_dir. | custy.log | No |
max_bytes | Size string | Maximum active-file size before rotation. The parser accepts size units such as KB, MB, and GB. | 10MB | No |
backup_count | Integer | Maximum number of rotated files retained. | 5 | No |
file_format | Logging format | Persistent Python logging format. Custy's formatter removes Rich markup. | %(asctime)s | %(levelname)s | %(name)s | %(message)s | No |
Generated file logging
toml[tool.custy.logging.file]
level = "DEBUG"
log_dir = "logs"
log_file = "custy.log"
max_bytes = "10MB"
backup_count = 5
file_format = "%(asctime)s | %(levelname)s | %(name)s | %(message)s"Rotation Example
With the generated values, custy.log rotates after roughly 10 MB and keeps
up to five numbered historical files in addition to the active log.