mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #3575] [MERGED] feat: add file logger support #5448
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#5448
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?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/3575
Author: @slavafyi
Created: 10/7/2025
Status: ✅ Merged
Merged: 10/9/2025
Merged by: @MHSanaei
Base:
main← Head:feature/file-logger📝 Commits (2)
9181ca8feat: add backend for file logger62123b1fix📊 Changes
2 files changed (+100 additions, -28 deletions)
View changed files
📝
logger/logger.go(+99 -27)📝
sub/sub.go(+1 -1)📄 Description
Hey there!
What is the pull request?
I faced a problem when using 3x-ui in Docker. I use this in my homelab along with other containers, so I don't want to setup it directly on the host. I want to ban those who try to access 3xui panel. But I found that the panel logs were only stored in memory, so fail2ban running on the host couldn't track them. This change adds a small modification to the logger to write each entry to
${XUI_LOG_FOLDER}/3xui.log. With this file, fail2ban can monitor the container logs just as it does today for IP Limit logs.I'm not a go developer, so if it looks bad, let me know if it's possible to add logs to file in another way. Thank you!
Which part of the application is affected by the change?
Type of Changes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.