File Logging
File Logging
Active
Simpan detailed records dalam 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 untuk persistent records. | DEBUG | No |
log_dir | Directory path | Directory yang dibuat saat logging diinisialisasi. | logs | No |
log_file | Filename | Active log filename di dalam log_dir. | custy.log | No |
max_bytes | Size string | Maximum active-file size sebelum rotation. Parser menerima size units seperti KB, MB, dan GB. | 10MB | No |
backup_count | Integer | Maximum number of rotated files yang dipertahankan. | 5 | No |
file_format | Logging format | Persistent Python logging format. Formatter Custy menghapus 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"Contoh Rotation
Dengan generated values, custy.log dirotasi setelah sekitar 10 MB dan
mempertahankan hingga lima numbered historical files selain active log.