feat: support user-defined configuration of log file size and retention count (#9610)

This commit is contained in:
zhuhao 2024-10-23 17:24:36 +08:00 committed by GitHub
commit c9dfe1ad92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 24 additions and 2 deletions

View file

@ -319,6 +319,16 @@ class LoggingConfig(BaseSettings):
default=None,
)
LOG_FILE_MAX_SIZE: PositiveInt = Field(
description="Maximum file size for file rotation retention, the unit is megabytes (MB)",
default=20,
)
LOG_FILE_BACKUP_COUNT: PositiveInt = Field(
description="Maximum file backup count file rotation retention",
default=5,
)
LOG_FORMAT: str = Field(
description="Format string for log messages",
default="%(asctime)s.%(msecs)03d %(levelname)s [%(threadName)s] [%(filename)s:%(lineno)d] - %(message)s",