Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK新增滚动日志功能 #700

Closed
wants to merge 4 commits into from

Conversation

C9luster
Copy link
Contributor

@C9luster C9luster commented Jan 2, 2025

完成SDK新增滚动日志功能,依据如下参数滚动:
(1)依据时间滚动
(2)依据文件大小滚动
(3)限制存留文件数量
(4)依据总文件的大小滚动
新增能力:
(1)分离DEBUG级别日志和ERROR级别日志,ERROR日志会独立输出到error开头的文件,此更改同步覆盖到原有的环境变量、setFilename功能中
注意:
(1)文件大小级别日志后缀为与时间滚动相同的时间戳

- console_show: 数据类型bool,默认值True,LOG日志是否在控制台输出
- loglevel: 数据类型str,默认值"DEBUG",LOG日志级别
- file_name: 数据类型str,默认值"tmp.log",LOG日志名称
- when: 数据类型str,默认值"MIDNIGHT",LOG日志滚动更新时间单位
Copy link
Contributor

@userpj userpj Jan 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这几个参数可以换成更通用的参数名称:
console_output
rotate_frequency
rotate_interval
max_file_size
total_log_size
max_log_files

backup_count: Optional[int] = None
):
LOGGING_CONFIG["handlers"] = {}
LOGGING_CONFIG["loggers"]["appbuilder"]["handlers"] = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOGGING_CONFIG["loggers"]["appbuilder"]["propagate"] = False

@C9luster C9luster closed this Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants