mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 16:15:49 -06:00
[GH-ISSUE #3229] log_file 指定的文件不会自动创建 #2592
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#2592
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wuai1024 on GitHub (Dec 28, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/3229
Describe the feature request
目前使用docker部署的frpc,指定了log_file后,启动会报 【logs.BeeLogger.SetLogger: open /var/log/frp/frpc.log: no such file 】
就是 文件不存在。
希望能在写入文件之前先判断下文件是否存在,如果不存在的话,自动创建下。
Describe alternatives you've considered
No response
Affected area
@wuai1024 commented on GitHub (Dec 28, 2022):
最好希望
1、日志能根据天进行分割
2、在输出文件日志的前提下也能保留console的输出。
console的输出供 docker log frpc 展示
file文件的输出,供 cat grep 等查询展示
@superzjg commented on GitHub (Dec 29, 2022):
我经常看log文件,frpc的log,如果不存在,是会在程序启动时自动创建的;但如果程序启动后,手动删除log文件,那么必须重启一次程序才能再次创建。如果定义了保留天数,比如 log_max_days = 3 那么会自动按日期切割,并保留之前的3天log。
@wuai1024 commented on GitHub (Dec 29, 2022):
我是用的最新版 v0.46 你用的哪个,你说的这个我都无法复现。
log配置
log_file = /opt/frpc.log
log_level = info
log_max_days = 365
disable_log_color = false
log_file 是我手动创建的。 也没根据 log_max_days 自动分割
@superzjg commented on GitHub (Dec 29, 2022):
我也是0.46版。图片中te文件夹中还有一个frpc.log,是上午我发帖之前测试的,看他会不会自动建目录te。
log_file = /var/log/frpc.log
log_level = info
log_max_days = 3
@wuai1024 commented on GitHub (Dec 29, 2022):
你把日志文件都删除了再测试看看,我的是不行。
@superzjg commented on GitHub (Dec 29, 2022):
我是openwrt,再次测试了,手动删了log文件以后,只要重启一次(/etc/init.d/frpc restart)就会自动创建;或者luci界面停用再启用;或者luci界面改一个设置重新保存应用都会自动创建。但luci界面不改设置保存应用不会,因为不需要重新load配置文件。
另外,我从0.43版一直用到0.46版,frps和frpc两个都在用,一直都会按天自动分割,与你唯一的不同,就是你设置的天数较大。
@wuai1024 commented on GitHub (Dec 29, 2022):
好的,多谢了。我再研究研究,我是在 群晖的docker中部署的。
@github-actions[bot] commented on GitHub (Jan 29, 2023):
Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.