Skip to main content

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]

DEBUG filerotationretention

Properties

Properties

PropertyTypeDescriptionDefaultRequired
levelDEBUG | INFO | WARNING | ERROR | CRITICALThreshold for persistent records.DEBUGNo
log_dirDirectory pathDirectory created when logging is initialized.logsNo
log_fileFilenameActive log filename inside log_dir.custy.logNo
max_bytesSize stringMaximum active-file size before rotation. The parser accepts size units such as KB, MB, and GB.10MBNo
backup_countIntegerMaximum number of rotated files retained.5No
file_formatLogging formatPersistent Python logging format. Custy's formatter removes Rich markup.%(asctime)s | %(levelname)s | %(name)s | %(message)sNo
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.

Continue