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

feat: support one or more log file #1400

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

linzeliang1222
Copy link

close #1271 #1247

新增 ONLY_ONE_LOG_FILE 变量,默认是 false,每日生成一个日志文件,如果设置为 true,则日志都写入到一个文件中,自己使用工具如 logrotate 对 one-api.log 进行日志管理

我已确认该 PR 已自测通过,相关截图如下:
image
image

@linzeliang1222
Copy link
Author

使用 logrotate 工具切割日志文件配置文件

/docker/one-api/data/logs/*.log {
    daily
    rotate 7
    missingok
    notifempty
    compress
    delaycompress
    dateext
    dateformat -%Y-%m-%d
    create 0640 root root
    copytruncate
}

Copy link
Author

@linzeliang1222 linzeliang1222 left a comment

Choose a reason for hiding this comment

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

pass

@songquanpeng
Copy link
Owner

ack

@linzeliang1222 linzeliang1222 deleted the linzeliang_log branch May 8, 2024 14:29
@linzeliang1222 linzeliang1222 restored the linzeliang_log branch May 8, 2024 15:45
@linzeliang1222 linzeliang1222 reopened this May 8, 2024
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.

增加定时清理 log 日志(急)
2 participants