mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2026-04-25 00:36:08 +03:00
[GH-ISSUE #312] 2.0 beta.17 容器中的 access.log 没有指向 /dev/stdout,这与文档描述不符 #1519
Labels
No labels
Q/A
bug
casdoor
dependencies
docker
documentation
duplicate
enhancement
help wanted
invalid
lego
platform:openwrt
platform:windows
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-ui#1519
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 @jearton on GitHub (Feb 20, 2024).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/312
Describe the bug
容器中的 access.log 和 error.log,按照文档里描述的,应该是一个符号链接文件,但现在却是真实文件。
To Reproduce
Steps to reproduce the behavior:
Expected behavior
应该指向标准输出流吧
Screenshots
Info (please complete the following information):
@0xJacky commented on GitHub (Feb 20, 2024):
你本地原来是不是有 access.log 了

@jearton commented on GitHub (Feb 20, 2024):
@0xJacky 你用的是 beta.17 验证的吗?
@jearton commented on GitHub (Feb 20, 2024):
宿主机上的 ~/test/nginx/log 目录是空的
@jearton commented on GitHub (Feb 20, 2024):
好吧,我知道了,把 -v ~/test/nginx/log:/var/log/nginx 去掉就对了,日志文件一旦持久化到宿主机上,这个符号链接就失效了
@0xJacky commented on GitHub (Feb 20, 2024):
是啊。。
@jearton commented on GitHub (Feb 20, 2024):
那以后每次升级镜像,容器需要销毁重新创建,这样历史日志就没有了
@0xJacky commented on GitHub (Feb 20, 2024):
单独映射 .local 文件到宿主机,就不要映射整个文件夹了吧,这个好像没有更好的解决办法
@0xJacky commented on GitHub (Feb 20, 2024):
或者放弃打印日志到控制台,这个我没改,官方的 nginx 镜像就是这样的,直接打印到控制台
@jearton commented on GitHub (Feb 20, 2024):
我有办法了,改变一下路径就可以了:-v ~/test/nginx/log:/var/log/nginx/local
然后把真实日志文件都存在这个子目录下面
@0xJacky commented on GitHub (Feb 20, 2024):
嗯,后面我更一下文档
@jearton commented on GitHub (Feb 20, 2024):
用这个方式验证了一下,没问题。对应的 logrotate 配置也要注意下。
@0xJacky commented on GitHub (Feb 20, 2024):
是的