mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5282] [Bug]: v3.3.1 cannot write log to file. #3695
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3695
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 @cwyin7788 on GitHub (Jun 13, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5282
Describe the bug
When I updated 3x-ui to 3.3.1, I've found that, it can't write the logs to file anymore, not only 1 machine, all updated to latest version 3-xui machine, also cannot write log to file, please fix this bug, thank you for developers attension.
How to reproduce the problem
I didn't to anything, just updated 3x-ui to the latest version, I've tried restart x-ui service, and the log still cannot write to file.
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.3.1
Xray-core version
No response
How did you install 3x-ui?
install.sh script
Operating system
Debian Trixie
Which parts of the panel are affected?
No response
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
None
Before submitting
@github-actions[bot] commented on GitHub (Jun 13, 2026):
This is a behavioral change introduced in v3.3.1 by commit
fix(xray): confine log.access/error to the panel log folder(merged 2026-06-12, just before the v3.3.1 tag).What changed
A new function
resolveXrayLogPathswas added ininternal/web/service/xray.go. Every time the Xray process starts, it takes thelog.accessandlog.errorpaths from the stored Xray template config, strips each to its base filename, and rewrites the path to be inside the panel's log folder (/var/log/x-ui/on Linux, or the value ofXUI_LOG_FOLDERif set). If the stored path is already inside that folder it is left unchanged. The values""and"none"are also left unchanged (they disable that log output).Practical effect
If you had previously set log paths to anything outside
/var/log/x-ui/— for example/etc/x-ui/access.logor/var/log/xray/access.log— those paths are silently rewritten at process-start time. The panel UI (Settings → Xray Configuration) still shows the old path that is stored in the database; only the runtimebin/config.jsoncontains the rewritten path.As a result, Xray is writing logs, but to
/var/log/x-ui/<basename>(e.g./var/log/x-ui/access.log), not the path shown in the editor.To confirm this is what is happening on your machines
/var/log/x-ui/:Workaround
Update the log paths in your stored Xray template config to be inside
/var/log/x-ui/. Open Settings → Xray Configuration in the panel, find thelogsection, and set the paths explicitly:After saving and restarting Xray (or the
x-uiservice), the configured path and the runtime path will match and the behaviour will be consistent.Background
This change was a security fix: an authenticated admin could previously point the supervised Xray process at an arbitrary file path by editing the raw Xray config. The fix intentionally restricts log output to the panel's log folder. It is a breaking change for any installation that had configured Xray log paths outside that folder, and the panel UI currently gives no indication that the path has been redirected.
Clarification needed
To confirm the above diagnosis applies to your case, please share:
logblock in your Xray template config (visible in Settings → Xray Configuration).ls -lh /var/log/x-ui/after restarting the service.x-ui.This reply was generated automatically by the issue-triage assistant; a maintainer may follow up.