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

Merged
merged 2 commits into from
Jul 3, 2024

Conversation

linzeliang1222
Copy link
Contributor

close #1271 #1247

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

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

@linzeliang1222
Copy link
Contributor 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
Contributor 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
Copy link
Collaborator

@Laisky Laisky left a comment

Choose a reason for hiding this comment

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

LGTM

@songquanpeng songquanpeng merged commit c4fe57c into songquanpeng:main Jul 3, 2024
2 of 3 checks passed
@songquanpeng
Copy link
Owner

thx~

jinjianming pushed a commit to jinjianming/one-api that referenced this pull request Jul 17, 2024
Co-authored-by: Laisky.Cai <github@laisky.com>
@linzeliang1222 linzeliang1222 deleted the linzeliang_log branch August 27, 2024 06:30
mxdlzg pushed a commit to mxdlzg/one-api that referenced this pull request Oct 15, 2024
Co-authored-by: Laisky.Cai <github@laisky.com>
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 日志(急)
3 participants